window.send_to_editor throws unterminated string literal error when adding image with multi line description

From comments:

You have to use the image_send_to_editor filter to filter the string before it arrives at the window.send_to_editor javascript function.

add_filter('image_send_to_editor', 'my_image_send_to_editor', 10, 2); 
function my_image_send_to_editor($html, $id) 
{ 
    $description = str_replace("\r\n",' ', $description); 
}