From 12b2dd309896d7ebecbba8677de6bc049c21a26c Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sun, 15 Aug 2021 20:57:38 +0000 Subject: [PATCH] Preserve the code block and remove the class from it when the language is not supported in CommonMark formatter (#35765, 32424). git-svn-id: http://svn.redmine.org/redmine/trunk@21181 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .../wiki_formatting/common_mark/syntax_highlight_filter.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb b/lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb index a027e6a17..316a7b8fd 100644 --- a/lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb +++ b/lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb @@ -38,8 +38,8 @@ module Redmine node.inner_html = html node["class"] = "#{lang} syntaxhl" else - # unsupported language, strip out the code tag - node.parent.inner_html = text + # unsupported language, remove the class attribute + node.remove_attribute("class") end end doc -- 2.39.5