diff options
-rw-r--r-- | app/helpers/application_helper.rb | 2 | ||||
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3409bb7be..b8cb965c7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -651,7 +651,7 @@ module ApplicationHelper if options[:formatting] == false text = h(text) else - formatting = options[:formatting] || Setting.text_formatting + formatting = Setting.text_formatting text = Redmine::WikiFormatting.to_html(formatting, text, :object => obj, :attribute => attr) end diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 020b4636c..3bb018be1 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -1297,6 +1297,14 @@ RAW end end + def test_textilizable_with_formatting_set_to_false_should_not_format_text + assert_equal '*text*', textilizable("*text*", :formatting => false) + end + + def test_textilizable_with_formatting_set_to_true_should_format_text + assert_equal '<p><strong>text</strong></p>', textilizable("*text*", :formatting => true) + end + def test_parse_redmine_links_should_handle_a_tag_without_attributes text = '<a>http://example.com</a>' expected = text.dup |