From: Marius Balteanu Date: Sun, 15 Aug 2021 20:57:38 +0000 (+0000) Subject: Preserve the code block and remove the class from it when the language is not support... X-Git-Tag: 5.0.0~268 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=12b2dd309896d7ebecbba8677de6bc049c21a26c;p=redmine.git 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 --- 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