Bug 456434

Summary: Okular does not handle markdown comments
Product: [Applications] okular Reporter: Marián Konček <koncek.marian>
Component: markdown backendAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: normal CC: aacid
Priority: NOR    
Version: 21.12.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Example which doesn't render properly

Description Marián Konček 2022-07-07 07:43:09 UTC
(Tested on Fedora 35)
If a markdown document contains (or at least starts with XML comments in the form of `<!-- ... -->`, Then it does not render the rest of the document properly.
Comment 1 Albert Astals Cid 2022-08-05 22:13:56 UTC
Please attach such a file for testing.
Comment 2 Marián Konček 2022-08-06 09:02:17 UTC
Sure, here:
https://github.com/osgi/osgi/blob/4ba3d49d9cc4b71dc1ed65ad8300d93e294601b6/README.md
https://github.com/raphw/byte-buddy/blob/94c0a54ca030ad1ae390015373376118e9fd83d5/README.md

I don't know whether XML is allowed in MD documents but KDE's syntax highlighter highlights XML nodes in MD documents when the file it opened in Kate for example.
Comment 4 Marián Konček 2022-08-06 09:26:20 UTC
Created attachment 151144 [details]
Example which doesn't render properly
Comment 5 Marián Konček 2022-08-06 09:26:52 UTC
No, but neither those are rendered by Okular and contain XML nodes.
Comment 6 Marián Konček 2022-08-06 09:32:08 UTC
(In reply to Marián Konček from comment #2)
> Sure, here:
> https://github.com/osgi/osgi/blob/4ba3d49d9cc4b71dc1ed65ad8300d93e294601b6/
> README.md
> https://github.com/raphw/byte-buddy/blob/
> 94c0a54ca030ad1ae390015373376118e9fd83d5/README.md
> 
> I don't know whether XML is allowed in MD documents but KDE's syntax
> highlighter highlights XML nodes in MD documents when the file it opened in
> Kate for example.

I used a wrong example, i downloaded it with wget, but the whole webpage, not just the document...

In any case I do remember other cases where this issue happened as I am a package maintainer and there was some case of such a document present in the sources.
Comment 7 Bug Janitor Service 2022-08-21 17:18:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/645
Comment 8 Albert Astals Cid 2022-08-31 17:29:28 UTC
Git commit 01871fdfff9363af3a90959650ef20ab9276c464 by Albert Astals Cid.
Committed on 31/08/2022 at 16:55.
Pushed by aacid into branch 'release/22.08'.

Even more tweaks to opening "text" files
Related: bug 430538

M  +10   -1    part/part.cpp

https://invent.kde.org/graphics/okular/commit/01871fdfff9363af3a90959650ef20ab9276c464