Bug 489881

Summary: Konsole always inserts an extra line break element in text/html clipboard
Product: [Applications] konsole Reporter: Thomas Lindroth <thomas.lindroth>
Component: copy-pasteAssignee: Konsole Developer <konsole-devel>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 23.08.5   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Thomas Lindroth 2024-07-07 15:25:34 UTC
On X11 systems there are multiple metadata fields associated with each clipboard, including a "text/html" field for preserving formatting information. If I select a word in Konsole and run "xclip -out -target text/html" I get a result like this:
<span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;">word</span><br></span>

I only selected the word, not the line break after it, but Konsole still inserts a <br> line break element after the word.

If I select multiple lines it looks like this:

<span style="font-family:monospace"><span style="color:#000000;background-color:#ffffff;">line1</span><br>line2<br>line3<br></span>

There are line break elements between each line as expected but also an extra line break element at the end even though I didn't select the line break.

This is annoying since the flashcard program Anki is parsing the text/html data. Whenever I copy a single word from Konsole to Anki I also get an extra line break after the word.

I am running Konsole 23.08.5 with Qt 5.15.14 on X11 Linux.