https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292021-08-15T11:16:26ZRedmineRedmine - Defect #35765: Code with unsupported code language is not render when CommonMark Markdown is usedhttps://www.redmine.org/issues/35765?journal_id=1037542021-08-15T11:16:26ZMarius BĂLTEANU
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/32424">Feature #32424</a>: CommonMark Markdown Text Formatting</i> added</li></ul> Redmine - Defect #35765: Code with unsupported code language is not render when CommonMark Markdown is usedhttps://www.redmine.org/issues/35765?journal_id=1037562021-08-15T11:21:44ZMarius BĂLTEANU
<ul><li><strong>Category</strong> set to <i>Text formatting</i></li></ul> Redmine - Defect #35765: Code with unsupported code language is not render when CommonMark Markdown is usedhttps://www.redmine.org/issues/35765?journal_id=1037612021-08-15T12:25:26ZMarius BĂLTEANU
<ul></ul><p>The following patch should fix this</p>
<pre><code class="diff syntaxhl"><span class="p">iff --git a/lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb b/lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb
</span><span class="gh">index a027e6a17..c7c43ee8b 100644
</span><span class="gd">--- a/lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb
</span><span class="gi">+++ b/lib/redmine/wiki_formatting/common_mark/syntax_highlight_filter.rb
</span><span class="p">@@ -39,7 +39,7 @@</span> module Redmine
node["class"] = "#{lang} syntaxhl"
else
# unsupported language, strip out the code tag
<span class="gd">- node.parent.inner_html = text
</span><span class="gi">+ node.parent.inner_html = CGI.escapeHTML(text)
</span> end
end
doc
</code></pre>
<p>but also the unified code blocks proposed by Martin in <a class="issue tracker-3 status-5 priority-4 priority-default closed" title="Patch: Code blocks - consistent rendering and retaining user-supplied language name in rendered HTML (Closed)" href="https://www.redmine.org/issues/35104">#35104</a> and <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: CommonMark Markdown Text Formatting (Closed)" href="https://www.redmine.org/issues/32424#note-39">#32424#note-39</a> should do the trick.</p> Redmine - Defect #35765: Code with unsupported code language is not render when CommonMark Markdown is usedhttps://www.redmine.org/issues/35765?journal_id=1037682021-08-15T21:03:32ZMarius BĂLTEANU
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li></ul><p>Fixed in <a class="changeset" title="Preserve the code block and remove the class from it when the language is not supported in Common..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/21181">r21181</a>.</p>
<p>Now we render the code block even if the language is not supported, but we remove the class attribute.</p> Redmine - Defect #35765: Code with unsupported code language is not render when CommonMark Markdown is usedhttps://www.redmine.org/issues/35765?journal_id=1037692021-08-15T21:03:39ZMarius BĂLTEANU
<ul><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul>