From a7a8b867a09d9dc52013ae5cc55a04aad32e7a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C4=82LTEANU?= Date: Thu, 29 Aug 2024 23:20:14 +0300 Subject: [PATCH 3/3] Disable syntax_highlighter plugin shipped by commonmark. --- lib/redmine/wiki_formatting/common_mark/formatter.rb | 3 +++ lib/redmine/wiki_formatting/common_mark/markdown_filter.rb | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/redmine/wiki_formatting/common_mark/formatter.rb b/lib/redmine/wiki_formatting/common_mark/formatter.rb index 1a705bd73..2eee19fa3 100644 --- a/lib/redmine/wiki_formatting/common_mark/formatter.rb +++ b/lib/redmine/wiki_formatting/common_mark/formatter.rb @@ -43,6 +43,9 @@ module Redmine unsafe: true, hardbreaks: Redmine::Configuration['common_mark_enable_hardbreaks'] == true ? true : false, }.freeze, + commonmarker_plugins: { + syntax_highlighter: nil + }.freeze, }.freeze MarkdownPipeline = HTML::Pipeline.new [ diff --git a/lib/redmine/wiki_formatting/common_mark/markdown_filter.rb b/lib/redmine/wiki_formatting/common_mark/markdown_filter.rb index abde25443..0b7f52ea3 100644 --- a/lib/redmine/wiki_formatting/common_mark/markdown_filter.rb +++ b/lib/redmine/wiki_formatting/common_mark/markdown_filter.rb @@ -36,7 +36,7 @@ module Redmine extension: extensions, render: render_options, parse: parse_options - }) + }, plugins: plugins ) html.rstrip! html @@ -55,6 +55,10 @@ module Redmine def render_options context.fetch :commonmarker_render_options, {} end + + def plugins + context.fetch :commonmarker_plugins, {} + end end end end -- 2.39.3 (Apple Git-146)