Bug 489881 - Konsole always inserts an extra line break element in text/html clipboard
Summary: Konsole always inserts an extra line break element in text/html clipboard
Status: REPORTED
Alias: None
Product: konsole
Classification: Applications
Component: copy-paste (show other bugs)
Version: 23.08.5
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-07 15:25 UTC by Thomas Lindroth
Modified: 2024-07-07 15:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.