]> source.dussan.org Git - redmine.git/commitdiff
Fixed: inline images in wiki headings (#4112).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 4 Nov 2009 10:22:57 +0000 (10:22 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 4 Nov 2009 10:22:57 +0000 (10:22 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2999 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redcloth3.rb
test/unit/helpers/application_helper_test.rb

index e99ccdf77a2de780169f1e6f1ae6df44865a9627..9da6c9ee83320b58356e7550165ebb3cca627619 100644 (file)
@@ -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
index 9db9434bd36c34c0f2b56ccca3e19b6f469bb9ba..27d6c473e081ca781682afa91136f57a97d9c91f 100644 (file)
@@ -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>',