Actions
Defect #35765
closedCode with unsupported code language is not render when CommonMark Markdown is used
Defect #35765:
Code with unsupported code language is not render when CommonMark Markdown is used
Resolution:
Fixed
Affected version:
Description
Files
Updated by Marius BĂLTEANU over 5 years ago
- Related to Feature #32424: CommonMark Markdown Text Formatting added
Updated by Marius BĂLTEANU over 5 years ago
- Category set to Text formatting
Updated by Marius BĂLTEANU over 5 years ago
The following patch should fix this
iff --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..c7c43ee8b 100644
--- a/lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb
+++ b/lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb
@@ -39,7 +39,7 @@ module Redmine
node["class"] = "#{lang} syntaxhl"
else
# unsupported language, strip out the code tag
- node.parent.inner_html = text
+ node.parent.inner_html = CGI.escapeHTML(text)
end
end
doc
but also the unified code blocks proposed by Martin in #35104 and #32424#note-39 should do the trick.
Updated by Marius BĂLTEANU over 5 years ago
- Status changed from New to Closed
Fixed in r21181.
Now we render the code block even if the language is not supported, but we remove the class attribute.
Updated by Marius BĂLTEANU over 5 years ago
- Resolution set to Fixed
Actions
