Summary: | Markdown files opened as plain text | ||
---|---|---|---|
Product: | [Applications] okular | Reporter: | Yaroslav Sidlovsky <zawertun> |
Component: | general | Assignee: | Okular developers <okular-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aacid, alfre2.as, bizyaev, filippo27998, generic, marcelo.jimenez, nate, ped, sh200105, simone, user6334 |
Priority: | NOR | ||
Version: | 21.12.3 | ||
Target Milestone: | --- | ||
Platform: | Manjaro | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/graphics/okular/commit/01871fdfff9363af3a90959650ef20ab9276c464 | Version Fixed In: | |
Attachments: |
Markdown file for tests
Opens as markdown document Doesn't open as markdown document |
Description
Yaroslav Sidlovsky
2020-12-18 11:53:03 UTC
Same here. Okular 20.12 Frameworks 5.76.0 Qt 5.15.2 Same here. OS: Arch Linux x86_64 Kernel: 5.4.84-1-lts KDE Plasma Version: 5.20.4 KDE Frameworks Version: 5.77.0 Qt Version: 5.15.2 Okular Version: 20.12.0 A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/347 Git commit 9e23338b002cd14d8a9ad191526a7950e72d97e9 by Albert Astals Cid. Committed on 27/12/2020 at 00:16. Pushed by aacid into branch 'release/20.12'. Fix opening markdown files In d2ae2c283df3d42e72a964d8891e0915f8f3a94b we introduced a tweak that broke opening markdown files. what we really want is this: * If the mimetype from the filename is text (or children) but looking at the data says it's not text, then try opening first opening with the data suggeted mimetype * But if the data suggested mimetype says it's text, use the filename suggested mimetype since for example, the only way to really differentiate markdown from text is the filename, so trust that M +4 -2 part/part.cpp https://invent.kde.org/graphics/okular/commit/9e23338b002cd14d8a9ad191526a7950e72d97e9 *** Bug 431183 has been marked as a duplicate of this bug. *** I'm reopening this bug as I've got the same behavior in the newer version (21.08.3). OS: Arch Linux x86_64 Kernel: 5.15.3-arch1-1 KDE Plasma Version: 5.23.3 KDE Gear: 21.08.3 Qt Version: 5.15.2 Okular Version: 21.08.3 The attached file works, so you'll have to give us one that doesn't After an update and a reboot, it started to work for me too. Sorry for the fuss. I have a lot of markdown documents opening with the Txt backend. Figured it out eventually, it seems to me like it's a bug. Attached 2 files, one opens with the Txt backend and the other with the Markdown backend. - Both are 'mime-type: text/plain' - Both show in Dolphin as 'Type: Markdown document' (*.md) But Dolphin properties show different recognized content: 'markdown.md' shows correctly 'Content: plain text document' 'notmarkdown.md' shows incorrectly 'Content: MATLAB file' The difference that triggers the content to be misdiagnosed is how the first line starts. Remove the first line from 'markdown.md' and the content changes to MATLAB document, consequently opening the file in Okular with the Txt backend. Created attachment 147560 [details]
Opens as markdown document
Created attachment 147561 [details]
Doesn't open as markdown document
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/645 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 456434 M +10 -1 part/part.cpp https://invent.kde.org/graphics/okular/commit/01871fdfff9363af3a90959650ef20ab9276c464 |