Pasting formatted text into mail composer: line-height: 100% converted to line-height: 1px
-
The below html code was generated by LibreOffice. Copying it into a text file and saving as an html one can test the issue I am reporting here.
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title></title> <meta name="generator" content="LibreOffice 7.4.7.2 (Linux)"/> <meta name="created" content="2024-12-21T00:43:38.952485149"/> <meta name="changed" content="2024-12-21T00:50:40.912318165"/> <style type="text/css"> @page { size: 21cm 29.7cm; margin: 2cm } p { line-height: 115%; margin-bottom: 0.25cm; background: transparent } a:link { color: #000080; so-language: zxx; text-decoration: underline } a:visited { color: #800000; text-decoration: underline } </style> </head> <body lang="hu-HU" link="#000080" vlink="#800000" dir="ltr"><p style="line-height: 100%; margin-bottom: 0cm"> Noch einmal ein Weihnachtsfest,</p> <p style="line-height: 100%; margin-bottom: 0cm">Immer kleiner wird der Rest, </p> <p style="line-height: 100%; margin-bottom: 0cm">Aber nehm' ich so die Summe, </p> <p style="line-height: 100%; margin-bottom: 0cm">Alles Grade, alles Krumme, </p> <p style="line-height: 100%; margin-bottom: 0cm">Alles Falsche, alles Rechte, </p> <p style="line-height: 100%; margin-bottom: 0cm">Alles Gute, alles Schlechte – </p> <p style="line-height: 100%; margin-bottom: 0cm">Rechnet sich aus allem Braus </p> <p style="line-height: 100%; margin-bottom: 0cm">Doch ein richtig Leben raus. </p> <p style="line-height: 100%; margin-bottom: 0cm">Und dies können ist das Beste </p> <p style="line-height: 100%; margin-bottom: 0cm">Wohl bei diesem Weihnachtsfeste.</p> <p style="line-height: 100%; margin-bottom: 0cm">Theodor Fontane (1819 - 1898)</p> <p style="line-height: 100%; margin-bottom: 0cm"><br/> </p> </body> </html>
Open the html file with LibreOffice and copy out the contents either with ctrl+c or right click -> copy. This will make available the above html code on the clipboard to any program requesting text/html format. To check this, I used the following command on Debian 12:
xclip -o -t text/html -selection c
Click write new message in Vivaldi to open a fresh message composer and paste the clipboard content into the message body. This will first look normal. However, if you continue typing in new content below the pasted text and the line gets long enough to break into a new line, then the new line will overlap with the previous one. Also, if you select the pasted text and change the paragraph type, the lines collapse together, all of them overlapping with eachother.
If you go to Drafts and check the source of the newly created draft message, you can recognize the cause of the problem:
The 'line-height: 100%' part in the pasted html code has been changed to 'line-height: 1px' in the message body that causes the lines to be spaced 1 pixel apart vertically, i.e. largely overlapping with eachother.I see several problems here:
- Probably the most obvious one that the property of the inserted text has been changed in a way that makes the rendering unitelligible.
- The second one is that this poor property is preserved for any further text typed into the message body after the pasted text.
- The third one is that there is no way in the message composer to change this property. I would say, if a certain property is not supported by the composer, then it preferably should not be preserved from the copied content. Or if preserved, then at least there should be an option to edit the html code to be able to manipulate these options not supported by the wysiwyg editor. Unfortunately, even the clear formatting button does not remove this erroneous property from the message body.
This is not the first time I run into this issue, but the first time I had time to put together a 'minimum reproducible example'. I was considering submitting a bug report for this, but this throubleshooting guide encourage me to discuss it on the forum first, thus I am writing this post. I also tried to search on this forum, but didn't find it reported elsewhere.
This is somewhat related to the issue of not having a plain text message composer, as this highlights the problem of using a stripped down html editor to compose html messages. In my opinion, this shouldn't be the default mode, let alone the only available composer mode exactly because this sorts of isses can make it very unreliable.
-
Please raise a bug report as issue can be reproduced and post the resulting VB reference here; maybe worthwhile noting that Remove formatting has no impact, i.e. issue persists
FWIW, where appropriate, consider using the following temporary workarounds until the issue resolved:
- press
Ctrl
+Shift
+V
to paste as plain text
- press
-
Okay, I submitted this and got reference VB-112732.