Created attachment 127459 [details] Test Case See attached test case: With HTML mode enabled, the quoted reply (wrapped in <blockquote>) is missing the line break between "HTML QUOTE" and "SECOND LINE". This works correctly in Thunderbird (see screenshot). (The reply not showing up was already fixed in Bug 419949.) I can reproduce this bug with KMail 5.9.2 (Qt 5.11.2 / KF 5.51) as well as KMail 5.14.40 (Qt 5.14.1 / KF 5.69).
Created attachment 127460 [details] KMail 5.14.40 vs. Thunderbird 68.6.
I confirm it
Git commit 6cc49743f3f9521e3a0f75083d9fd6c01e019250 by Laurent Montel. Committed on 13/10/2021 at 06:11. Pushed by mlaurent into branch 'release/21.08'. Fix Bug 419978 - KMail missing line break in blockquote when showing as HTML mail FIXED-IN: 5.18.3 M +2 -1 templateparser/src/templateparserjob.cpp https://invent.kde.org/pim/messagelib/commit/6cc49743f3f9521e3a0f75083d9fd6c01e019250
Thanks, but I'm afraid this does not fix the bug for me. I tested a build of messagelib master based on eead28d3, where the quoted HTML text still displayed as "a b" instead of what it should look like: "a b" Are you sure you have tested the attached test case in HTML mode (in plaintext mode it was already working before) and looked at the quoted text at the bottom? Or perhaps the commit did not include all changes necessary?
code from your email: " <div>You wrote:<blockquote style="margin: 0.8ex 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">HTML QUOTE SECOND LINE </blockquote></div> " create a t.html put these line into. Open it with firefox you can see that there is a bug. So indeed a broken generated code will provide a bad rendering. I can't fix a bug in existing email. I can fix when I generate html code (already done)
I agree the code generated by some mail apps (GMX app in particular) is often problematic, sadly some senders insist on using them. However, it leads to KMail displaying the whole multi-paragraph quote without any linebreaks whatsoever, which is not what was intended by the sender and which is very hard to read. As you can see from the screenshot, Thunderbird is able to display the mail just fine. I just retested with Thunderbird 91.2, it still works there. If "t.html" does not work in Firefox, it means Thunderbird (which also uses the Gecko engine) might have added a workaround, e.g. transforming "blockquote" to "pre" (while making sure to copy over other styling such as the use of a non-monospace font). It would be great if KMail was able to reach the same level of compatibility, even for "broken" mails.
(In reply to null from comment #6) > I agree the code generated by some mail apps (GMX app in particular) is > often problematic, sadly some senders insist on using them. However, it > leads to KMail displaying the whole multi-paragraph quote without any > linebreaks whatsoever, which is not what was intended by the sender and > which is very hard to read. > > As you can see from the screenshot, Thunderbird is able to display the mail > just fine. I just retested with Thunderbird 91.2, it still works there. If > "t.html" does not work in Firefox, it means Thunderbird (which also uses the > Gecko engine) might have added a workaround, e.g. transforming "blockquote" > to "pre" (while making sure to copy over other styling such as the use of a > non-monospace font). > > It would be great if KMail was able to reach the same level of > compatibility, even for "broken" mails. If thunderbird has a workaround about it it's directly in gecko engine, if I want to make a workaround I need to parse html text before displaying it, it will need a lot of regexp which increase time to display message. It's very not good as I need to do it for each message...
I thought KMail was already sanitizing messages somewhat for Qt to consume anyway, so the performance impact would be negligible. If that is not the case and this would impact performance for the majority of cases too much, feel free to close the bug as WONTFIX or keep it open in case someone else has a good idea for a better fix. I'm fine with both, as long as we do not pretend the issue is FIXED already. I will have to investigate piping incoming mail through a filter to replace linebreaks in blockquotes from that sender with "<br>" (obviously modifying incoming mail is a no-go to include in upstream KMail). Thanks anyway for your help so far.