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 = / - (

|\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 "

#{result}

", 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?('') + assert textilizable(raw).include?('') + end + def test_acronyms to_test = { 'this is an acronym: GPL(General Public License)' => 'this is an acronym: GPL',