Bug 499497

Summary: Okular renders Markdown files wrongly. Code blocks are not always recognized.
Product: [Applications] okular Reporter: Paul Sommer <nl>
Component: markdown backendAssignee: Okular developers <okular-devel>
Status: RESOLVED DUPLICATE    
Severity: normal CC: john.kizer
Priority: NOR    
Version First Reported In: 23.08.5   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Paul Sommer 2025-02-04 10:54:55 UTC
SUMMARY
Okular renders Markdown files wrongly. Code blocks are not always recognized.

STEPS TO REPRODUCE
1. create a .md file with a code block like so:

The is a line with some arbitrary text. Next line is code.
```
my_project/
│-- src/                # Quellcode des Programms
│   │-- main.py         # Haupteinstiegspunkt
```
2. open it in Okular

OBSERVED RESULT
The code part is not reconized as code and is printed like so:

The is a line with some arbritary test. Next line is code
my_project/ │-- src/                # Quellcode des Programms │   │-- main.py         # Haupteinstiegspunkt

EXPECTED RESULT
The code should be printed as code


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 24.04
KDE Plasma Version: current
KDE Frameworks Version: current
Qt Version: current

ADDITIONAL INFORMATION
Things work as intended when there is a blank line before the opening ```

I don't know what the official standard behavior is, but all markup renderers I know output code as code even without a previous blank line.
Comment 1 John Kizer 2025-02-11 05:54:20 UTC
Hi - merging this in with the previous bug that was filed for this topic. For what it's worth, the specific upstream issue that's referenced in the comments there is https://github.com/Orc/discount/issues/286

Thanks!

*** This bug has been marked as a duplicate of bug 484443 ***