Bug 504083 - 1st level heading won't be correctly rendered if the Markdown document uses UTF-8 BOM(byte-order mark)
Summary: 1st level heading won't be correctly rendered if the Markdown document uses U...
Status: CONFIRMED
Alias: None
Product: okular
Classification: Applications
Component: markdown backend (other bugs)
Version First Reported In: 25.04.1
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-12 03:34 UTC by 林博仁(Buo-ren, Lin)
Modified: 2025-05-12 03:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Bug reproduction screenshot (142.61 KB, image/png)
2025-05-12 03:34 UTC, 林博仁(Buo-ren, Lin)
Details
Minimal Markdown document for bug reproduction (158 bytes, text/markdown)
2025-05-12 03:36 UTC, 林博仁(Buo-ren, Lin)
Details
Workarounded bug reproduction file(just strip the BOM will do) (155 bytes, text/markdown)
2025-05-12 03:37 UTC, 林博仁(Buo-ren, Lin)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 林博仁(Buo-ren, Lin) 2025-05-12 03:34:50 UTC
Created attachment 181190 [details]
Bug reproduction screenshot

SUMMARY

If the following requirements are met for a Markdown document:

* The file is saved with (UTF-8) BOM
* The 1st-level heading is at the beginning of the file

The 1st-level heading will be wrongly rendered as regular text.

STEPS TO REPRODUCE
1. Launch Kate.
2. In Kate, create a new Markdown document.
3. In the new document, write `# title` at the beginning of the file.
4. Toggle the Tools > Add Byte Order Mark (BOM) menu option.
5. Save the file.
6. Open the saved file using Okular and verify its rendered result.

OBSERVED RESULT

The 1st-level heading is wrongly rendered as regular text.

EXPECTED RESULT

The 1st-level heading is correctly rendered as 1st-level heading.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 24.04
KDE Plasma Version: 5.27.12
KDE Frameworks Version(Flatpak): 6.13.0
Qt Version(Flatpak): 6.9.0

ADDITIONAL INFORMATION

Reproduced on the Flatpak distribution of Okular, version 25.04.1.
Comment 1 林博仁(Buo-ren, Lin) 2025-05-12 03:35:23 UTC
Markdown backend version: 0.1.0
Comment 2 林博仁(Buo-ren, Lin) 2025-05-12 03:36:13 UTC
Created attachment 181191 [details]
Minimal Markdown document for bug reproduction
Comment 3 林博仁(Buo-ren, Lin) 2025-05-12 03:37:52 UTC
Created attachment 181192 [details]
Workarounded bug reproduction file(just strip the BOM will do)
Comment 4 Jeff Huang 2025-05-12 03:54:43 UTC
Confirmed on Arch Linux in Okular 25.04.0