]> source.dussan.org Git - redmine.git/commitdiff
Preserve the code block and remove the class from it when the language is not support...
authorMarius Balteanu <marius.balteanu@zitec.com>
Sun, 15 Aug 2021 20:57:38 +0000 (20:57 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Sun, 15 Aug 2021 20:57:38 +0000 (20:57 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@21181 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb

index a027e6a17fe2d3e68b9416076724691b40f5dd74..316a7b8fd73d09830ba79b439884cb56fcdda132 100644 (file)
@@ -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