Fix handling line breaks when quoting selection in QR

The previous code caused, among others, merging of two-line selections
into one line.