diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 43f32fbc7..3177d0eb7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1855,10 +1855,10 @@ module ApplicationHelper # Returns the markdown formatter: markdown or common_mark # ToDo: Remove this when markdown will be removed def markdown_formatter - if Setting.text_formatting == "common_mark" - "common_mark" - else + if Setting.text_formatting == "markdown" "markdown" + else + "common_mark" end end diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index fc0351885..ddc55dcb8 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -2229,6 +2229,20 @@ class ApplicationHelperTest < Redmine::HelperTest end end + # TODO: Remove this test when Redcarpet-based Markdown formatter is removed + def test_markdown_formatter + [ + ['markdown', 'markdown'], + ['common_mark', 'common_mark'], + ['textile', 'common_mark'], + ['', 'common_mark'] + ].each do |text_formatting, expected| + with_settings text_formatting: text_formatting do + assert_equal expected, markdown_formatter + end + end + end + private def wiki_links_with_special_characters