Created attachment 108726 [details] Misidentified md If a file does not have H1 tag, it is identified as x-matlab.
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.
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.
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.