Unexpected empty lines when copying-pasting
Describe the bug
Hello!
When I copy text in memo using selection, in pasting blank lines appear between. Expected that this to work like the built-in copy function works now, without gaps.
https://user-images.githubusercontent.com/118022040/203881939-a18b5c73-d028-4599-9570-5509b1799c2a.mov
Steps to reproduce
- Select text in a memo
- Copy it with
ctrl+cor using context menu - Paste in some input field/text editor
Screenshots or additional context
I didn't dive deep into what goes to clipboard, but in some text editors it can be pasted with no empty lines, some not. In my glance, this is because of memo markup. Every line goes into the own paragraph.
<p>First line</p>
<p>Second line</p>
Which, without clipboard control, leads to this issue.
I think the extra empty lines are added when selected and copied from the rich-text (including in other websites). So maybe it's better to handle it when pasting ?
I mentioned that some editors not insert extra lines. But probably they are doing it wrong :) most of the apps add these lines.
I think there is another option if extra lines don't come from the rich-text. I would suggest don't split each line into a separate <p> element, but put them together in one paragraph, maybe, or split with <br>. It will not copy extra lines. As I know, many web markdown viewers do like that.
<p>
First line <!-- <br> could be here -->
Second line
</p>