When editing a document and changing the format (like turning plain text into Markdown formatted one), the preview does not update. Even not when saving to a new file with a new file suffix. Reason is that the plugin relies on the MIME type reported for the document. Right now KTextEditor only estimates that MIME type on request instead of maintaining this property itself and notifying clients about any changes (see bugs this report depends on). Workaround: Best ensure the changed document is saved at least once (for MIME types only detected by file suffix). Then either close & open again the file or switch the preview plugin shortly to preview another open document.
Confirmed this is still an issue in kate from git master.
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1189
*** Bug 466377 has been marked as a duplicate of this bug. ***
Git commit 026fcc08f986b5a99ecf10ebe8a1749312eaf4cd by Christoph Cullmann, on behalf of Waqar Ahmed. Committed on 07/04/2023 at 13:48. Pushed by cullmann into branch 'master'. Fix preview for markdown files not loaded on mode change For markdown files no mimetype gets returned, so just manually add the mimetype M +5 -0 addons/preview/previewwidget.cpp https://invent.kde.org/utilities/kate/commit/026fcc08f986b5a99ecf10ebe8a1749312eaf4cd
Git commit 86780f90aa45efb97a7448b2311c4a096bfcf35f by Waqar Ahmed. Committed on 08/04/2023 at 10:37. Pushed by waqar into branch 'release/23.04'. Fix preview for markdown files not loaded on mode change For markdown files no mimetype gets returned, so just manually add the mimetype (cherry picked from commit 026fcc08f986b5a99ecf10ebe8a1749312eaf4cd) M +5 -0 addons/preview/previewwidget.cpp https://invent.kde.org/utilities/kate/commit/86780f90aa45efb97a7448b2311c4a096bfcf35f