]> source.dussan.org Git - redmine.git/commitdiff
Simplify code (#40197).
authorMarius Balteanu <marius.balteanu@zitec.com>
Sun, 3 Nov 2024 12:03:32 +0000 (12:03 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Sun, 3 Nov 2024 12:03:32 +0000 (12:03 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@23189 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/common_mark/formatter.rb

index 4a0a7ec53c19b9a501cdbb4e1727c89d6cbb3718..1a705bd73bb953c9f0b8024ee98bbd33e1faa19b 100644 (file)
@@ -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,