Bug 436288

Summary: Wrong indentation in pre-formatted html content (5.78 regression)
Product: [Frameworks and Libraries] frameworks-syndication Reporter: Alexander Miller <alex.miller>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal CC: a.samirh78, faure
Priority: NOR    
Version: 5.80.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Alexander Miller 2021-04-28 01:20:23 UTC
Since commit 9a54df8b ("Port away from deprecated QXmlInputSource"), syndication changes the indentation of lines that start with a tag in the html content of a feed item. That doesn't matter in most places, but it's a problem where whitespace should be preserved, like in a <pre> block or a tag with style="white-space:pre".

As a result, after upgrading from frameworks 5.77 to 5.80, newly fetched articles of a feed that regularly uses pre-formatted content with additional markup are shown with wrongly indented lines in akregator, while old, archived articles still render correctly. Reverting the commit mentioned above fixes the problem.

A small made-up example to illustrate the problem:
If an article contains
<pre>
line 1
<b>line</b> 2
line 3
</pre>
then several spaces will be added in front of line 2, which is wrong.

The offending commit should be reverted and then the deprecated method may be replaced with a different solution that doesn't cause regressions.
Comment 1 Christophe Marin 2021-04-29 10:44:36 UTC
David, the commit mentioned here is one you pushed.
Comment 2 Ahmad Samir 2021-05-01 16:55:35 UTC
A link to an affected feed would be nice to test with here :)