Bug 386595 - text/markdown mimetype misidentified as text/x-matlab
Summary: text/markdown mimetype misidentified as text/x-matlab
Status: RESOLVED WORKSFORME
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-06 18:37 UTC by Edward Kigwana
Modified: 2019-08-25 10:44 UTC (History)
2 users (show)

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


Attachments
Misidentified md (502 bytes, text/markdown)
2017-11-06 18:37 UTC, Edward Kigwana
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Edward Kigwana 2017-11-06 18:37:00 UTC
Created attachment 108726 [details]
Misidentified md

If a file does not have H1 tag, it is identified as x-matlab.
Comment 1 Edward Kigwana 2017-11-06 19:10:09 UTC
I opened the file location using konqueror and the markdown file is also identified as plain text by observing rendered icon. The Wierd part is that dolphin shows a markdown icon but clicking the file launches kate instead of Okular.
Comment 2 Friedrich W. H. Kossebau 2017-11-06 19:58:28 UTC
The preview plugin itself relies on the mimetype info provided from the ktexteditor API, it does not do any mimetype estimation itself.
So moving to ktexteditor.

Chance is though that detection of markdown files is tricky, as KDE code usually relies on QMimeDatabase, which uses shared-mime-info as database for detetion. And that one has only data about the file suffix, no magic bytes logic (see https://cgit.freedesktop.org/xdg/shared-mime-info/tree/freedesktop.org.xml.in#n5980 )


Please report the bug about Dolphin separately with Dolphin.
Comment 3 Christoph Cullmann 2019-08-25 10:44:05 UTC
Hmm, for me this opens as Markdown.
We might improve the mimetype communicated to the preview plugin via bug 384449
If I misunderstand the issue, please reopen, thanks.