From: Jean-Philippe Lang Date: Tue, 21 Apr 2009 12:49:16 +0000 (+0000) Subject: Less aggressive textile image tag parsing (#3209). X-Git-Tag: 0.9.0~516 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6bb550838777352180534da7a7f807cbf5f0db7f;p=redmine.git Less aggressive textile image tag parsing (#3209). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2677 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index e0dca80e2..a4d33f804 100644 --- a/lib/redcloth3.rb +++ b/lib/redcloth3.rb @@ -907,7 +907,7 @@ class RedCloth3 < String end IMAGE_RE = / - (

|.|^) # start of line? + (

|\s|^) # start of line? \! # opening (\<|\=|\>)? # optional alignment atts (#{C}) # optional style,class atts diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index a8b7edea5..21ed10ae5 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -57,6 +57,8 @@ class ApplicationHelperTest < HelperTestCase 'ftp://foo.bar' => 'ftp://foo.bar', 'ftps://foo.bar' => 'ftps://foo.bar', 'sftp://foo.bar' => 'sftp://foo.bar', + # two exclamation marks + 'http://example.net/path!602815048C7B5C20!302.html' => 'http://example.net/path!602815048C7B5C20!302.html', } to_test.each { |text, result| assert_equal "

#{result}

", textilizable(text) } end @@ -110,6 +112,8 @@ class ApplicationHelperTest < HelperTestCase "This is a double quote \"on the first line\nand another on a second line\":test" => "This is a double quote \"on the first line
\nand another on a second line\":test", # mailto link "\"system administrator\":mailto:sysadmin@example.com?subject=redmine%20permissions" => "system administrator", + # two exclamation marks + '"a link":http://example.net/path!602815048C7B5C20!302.html' => 'a link', } to_test.each { |text, result| assert_equal "

#{result}

", textilizable(text) } end