From e78a019a183013f15f765feaed41cca5c1ee433b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C4=82LTEANU?= Date: Thu, 29 Aug 2024 22:36:29 +0300 Subject: [PATCH 2/3] Simplify code. --- lib/redmine/wiki_formatting/common_mark/formatter.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/redmine/wiki_formatting/common_mark/formatter.rb b/lib/redmine/wiki_formatting/common_mark/formatter.rb index 4a0a7ec53..1a705bd73 100644 --- a/lib/redmine/wiki_formatting/common_mark/formatter.rb +++ b/lib/redmine/wiki_formatting/common_mark/formatter.rb @@ -40,15 +40,11 @@ module Redmine # https://github.com/gjtorikian/commonmarker#render-options commonmarker_render_options: { - unsafe: true - }, + unsafe: true, + hardbreaks: Redmine::Configuration['common_mark_enable_hardbreaks'] == true ? true : false, + }.freeze, }.freeze - if Redmine::Configuration['common_mark_enable_hardbreaks'] == true - PIPELINE_CONFIG[:commonmarker_render_options].merge!({hardbreaks: true}) - end - PIPELINE_CONFIG[:commonmarker_render_options].freeze - MarkdownPipeline = HTML::Pipeline.new [ MarkdownFilter, SanitizationFilter, -- 2.39.3 (Apple Git-146)