File opened via okular renders as expected. Same file viewed via ktexteditorpreviewplugin renders plain text. Selecting kmarkdown web view part instead of okularmd shows what I'd expect.
This is not a problem in Okular, but in the (experimental) KTextEditorPreviewPlugin. Due to the way this plugin forwards the file to Okular, Okular can't know the mime type of the file, thus falls back to plain text. See https://phabricator.kde.org/D7455#138854
Friedrich, can you confirm this?
I do not have Okular from master branch, so cannot test this myself for Markdown documents. But the KParts plugin used should know about the mimetype, it is passed both when loading via a file and when loading via a stream. Cmp. KPartView::updatePreview(): https://cgit.kde.org/kate.git/tree/addons/preview/kpartview.cpp#n161 (merged now into the kate repo) So by theory (and experience with other KParts plugins) the Okular KParts plugin "should" know about the mimetype, so without knowing more I suspect some issues on the Okular side :)
Thanks for clarifying. I will look into this then.
Git commit d19834f231acc31d058978b1f01b70c0eee332bf by Albert Astals Cid, on behalf of Julian Wolff. Committed on 25/02/2018 at 10:46. Pushed by aacid into branch 'Applications/17.12'. Make Part::openUrl not discard OpenUrlArguments Applications using Okular as a KPart might set a file's mime type in the OpenUrlArguments. Okular currently clears the arguments while opening a document. This revision fixes this, allowing applications to actually pass a file's mime type to Okular. M +17 -0 autotests/parttest.cpp M +6 -0 part.cpp https://commits.kde.org/okular/d19834f231acc31d058978b1f01b70c0eee332bf