[okular] [Bug 510945] okular fails to render strike through formatted text of markdown documents (2)
Sune Vuorela
bugzilla_noreply at kde.org
Fri Nov 14 09:46:38 GMT 2025
https://bugs.kde.org/show_bug.cgi?id=510945
Sune Vuorela <sune at vuorela.dk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Latest Commit| |https://invent.kde.org/grap
| |hics/okular/-/commit/656683
| |8bb259622f023476af17f753ae4
| |a9b3530
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #7 from Sune Vuorela <sune at vuorela.dk> ---
Git commit 6566838bb259622f023476af17f753ae4a9b3530 by Sune Vuorela, on behalf
of Ben Morris.
Committed on 14/11/2025 at 09:36.
Pushed by sune into branch 'master'.
Do not process HTML with QDomDocument
`QDomDocument` was used to replace `<del>` tags in Discount's output with `<s>`
tags.
`QDomDocument::setContent()` parses XML only. This usually works, because
Discount's HTML is usually valid XML. However, since it is in "Smartypants"
mode, Discount generates named character references in response to certain
inputs, e.g. `(c)` -> `©` and `...` -> `…`. These are valid HTML,
but most are not predefined in standard XML, and so QDomDocument refuses to
parse them.
This MR uses `QString::replace()` in place of `QDomDocument`.
I know it's generally frowned upon to process HTML by such simple approaches,
but within the constraints of HTML which Discount generates, I can't see a way
that this could go wrong.
M +6 -18 autotests/markdowntest.cpp
M +4 -28 generators/markdown/converter.cpp
https://invent.kde.org/graphics/okular/-/commit/6566838bb259622f023476af17f753ae4a9b3530
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Okular-devel
mailing list