diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-04 10:22:57 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-11-04 10:22:57 +0000 |
commit | 9943f64ff07527814be87328084665952d97a5f3 (patch) | |
tree | ea1fd4b4080b2411508471f087fa2bf6ef7c1898 | |
parent | 03548f2d63bea5e33613f0ba011af5b2c1838f04 (diff) | |
download | redmine-9943f64ff07527814be87328084665952d97a5f3.tar.gz redmine-9943f64ff07527814be87328084665952d97a5f3.zip |
Fixed: inline images in wiki headings (#4112).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2999 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | lib/redcloth3.rb | 2 | ||||
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index e99ccdf77..9da6c9ee8 100644 --- a/lib/redcloth3.rb +++ b/lib/redcloth3.rb @@ -912,7 +912,7 @@ class RedCloth3 < String end IMAGE_RE = / - (<p>|\s|^) # 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 9db9434bd..27d6c473e 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -81,6 +81,19 @@ class ApplicationHelperTest < HelperTestCase to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } end + def test_inline_images_inside_tags + raw = <<-RAW +h1. !foo.png! Heading + +Centered image: + +p=. !bar.gif! +RAW + + assert textilizable(raw).include?('<img src="foo.png" alt="" />') + assert textilizable(raw).include?('<img src="bar.gif" alt="" />') + end + def test_acronyms to_test = { 'this is an acronym: GPL(General Public License)' => 'this is an acronym: <acronym title="General Public License">GPL</acronym>', |