diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-11-11 07:35:24 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-11-11 07:35:24 +0000 |
commit | 78970eb649dc63ad2e2fb18334690a301aefe022 (patch) | |
tree | 3200aad127be4ae24cd4af91522f0f4fb933c663 | |
parent | ac0cf9916cca578de916a7c8384b6ceaedfefe2a (diff) | |
download | redmine-78970eb649dc63ad2e2fb18334690a301aefe022.tar.gz redmine-78970eb649dc63ad2e2fb18334690a301aefe022.zip |
Merged r14863 (#6969).
git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14865 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | lib/redcloth3.rb | 2 | ||||
-rw-r--r-- | test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb | 9 |
2 files changed, 2 insertions, 9 deletions
diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index dc1058026..31a558799 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 a505b6661..5c7735547 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb @@ -154,19 +154,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 <script>' => 'this is a <script>' ) end - def test_should_escape_less_than_signs - assert_html_output( - '<' => '<', - '1 < 2' => '1 < 2' - ) - end - def test_use_of_backslashes_followed_by_numbers_in_headers assert_html_output({ 'h1. 2009\02\09' => '<h1>2009\02\09</h1>' |