From: Jean-Philippe Lang Date: Wed, 11 Nov 2015 07:34:15 +0000 (+0000) Subject: Reverts r14812 (#6969). X-Git-Tag: 3.2.0~36 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=868d949f47c2767f2d8943edf530dfbc9d00fb73;p=redmine.git Reverts r14812 (#6969). git-svn-id: http://svn.redmine.org/redmine/trunk@14863 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index 20cccac5b..f9c9054b8 100644 --- a/lib/redcloth3.rb +++ b/lib/redcloth3.rb @@ -1202,7 +1202,7 @@ class RedCloth3 < String ALLOWED_TAGS = %w(redpre pre code notextile) def escape_html_tags(text) - text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)?(>?)}) {|m| $2 && ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "<#{$1}#{'>' unless $3.blank?}" } + text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "<#{$1}#{'>' unless $3.blank?}" } end end diff --git a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb index de0e5086e..65a91b20a 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb @@ -160,19 +160,12 @@ EXPECTED assert_equal expected.gsub(%r{\s+}, ''), to_html(raw).gsub(%r{\s+}, '') end - def test_should_escape_unallowed_tags + def test_escaping assert_html_output( 'this is a