[education/rkward] rkward/windows: Allow markdown preview for quarto (.qmd) files

Thomas Friedrichsmeier null at kde.org
Tue Sep 23 13:01:02 BST 2025


Git commit 2b055006768c9f96d3a389d771a6a9e1eccaae05 by Thomas Friedrichsmeier.
Committed on 23/09/2025 at 12:00.
Pushed by tfry into branch 'master'.

Allow markdown preview for quarto (.qmd) files

M  +2    -1    rkward/windows/rkcommandeditorwindow.cpp

https://invent.kde.org/education/rkward/-/commit/2b055006768c9f96d3a389d771a6a9e1eccaae05

diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkcommandeditorwindow.cpp
index 08647f6b2..79b3f957f 100644
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@ -709,7 +709,8 @@ void RKCommandEditorWindow::initPreviewModes(KActionMenu *menu) {
 
 	const auto valid_for_any_markdown = [](KTextEditor::Document *doc) -> bool {
 		if (documentHighlightingMode(doc) == RKCommandHighlighter::RMarkdown) return true;
-		return doc->highlightingMode().toLower().contains(u"markdown"_s);
+		if (doc->highlightingMode().toLower().contains(u"markdown"_s)) return true;
+		return doc->url().url().toLower().endsWith(u"md"_s); // .qmd (Quarto) and other mardown flavours, we may not be aware of
 	};
 	const auto valid_for_r_script = [](KTextEditor::Document *doc) -> bool {
 		return (documentHighlightingMode(doc) == RKCommandHighlighter::RScript);


More information about the rkward-tracker mailing list