[okular] [Bug 488497] Consider QTextDocument markdown implementation over libdiscount
Sune Vuorela
bugzilla_noreply at kde.org
Tue Jun 18 08:17:33 BST 2024
https://bugs.kde.org/show_bug.cgi?id=488497
Sune Vuorela <kde at pusling.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Markdown not respecting |Consider QTextDocument
|linebreak |markdown implementation
| |over libdiscount
Resolution|NOT A BUG |---
Status|NEEDSINFO |CONFIRMED
--- Comment #5 from Sune Vuorela <kde at pusling.com> ---
(In reply to machinedreamcatcher from comment #4)
> > I do think that - at some point - it could make sense to switch Okular from libdiscount to Qt's recently-ish gained markdown support (iirc based upon md4c) but don't hold your breath for it. Will happily review patches though.
>
> Markdown-related methods seems to be implemented in `QTextDocument` &
> `QTextEdit` classes. Are those related to the former what you had in mind ?
> https://docs.w3cub.com/qt/qtextdocument#setMarkdown
> https://docs.w3cub.com/qt/qtextdocument#toMarkdown
Yep. something like the setMarkdown could be a way
> https://invent.kde.org/graphics/okular/-/tree/master/generators/
> markdown?ref_type=heads
Correct.
> Would you have in mind:
> 1. Where in the code is libmarkdown (Discount) being called so far ? I could
> see mentions of it in what seem the build instructions or as comments in
> `/generators/markdown/converter.cpp`, but could not spot an actual call to
> the library.
It is in the convertOpenFile function in that file it is called that all calls
to libdiscount is, iirc.
> 2. Is the Markdown class (in converter.cpp) used to both render view and
> generate file ?
Okular has a class of generators that just converts input to a QTextDocument.
This is one of them, so it is basically done once a QTextDocument is generated.
> Also, should QT/MD4C Markdown renderer be implemented as the new and only
> markdown backend, or should it be optional and offered as an alternative
> backend to Discount in the [configuration
> window](https://docs.kde.org/stable5/en/okular/okular/configure-backends.
> html)?
I think a first approximation would be to just replace the current one.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Okular-devel
mailing list