プロジェクト

全般

プロフィール

Vote #81604

完了

Code with unsupported code language is not render when CommonMark Markdown is used

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Text formatting_26
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
26
version_id:
0
issue_org_id:
35765
author_id:
107353
assigned_to_id:
107353
comments:
5
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

The following code snippet:

```phpvb


is render as following:
!{border: 1px solid grey; width:80%;}empty.png!

In textile and classic Markdown, the code is rendered without any syntax highlight (as exppected).


journals

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
The following patch should fix this

<pre><code class="diff">
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
</code></pre>

but also the unified code blocks proposed by Martin in #35104 and #32424#note-39 should do the trick.
--------------------------------------------------------------------------------
Fixed in r21181.

Now we render the code block even if the language is not supported, but we remove the class attribute.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,32424,CommonMark Markdown Text Formatting

Admin Redmine さんが約2年前に更新

  • カテゴリText formatting_26 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0