From ff1b7f4832cb9c1db1e922dea2866b2ac1749636 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 4 Nov 2009 10:23:53 +0000 Subject: [PATCH] Merged r2999 from trunk. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@3000 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redcloth3.rb | 2 +- test/unit/helpers/application_helper_test.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index a4d33f804..6c1d9fd35 100644 --- a/lib/redcloth3.rb +++ b/lib/redcloth3.rb @@ -907,7 +907,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 a16202f86..09982e335 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -79,6 +79,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', -- 2.39.5