Changeset 296

Show
Ignore:
Timestamp:
04/14/2008 10:01:36 (7 months ago)
Author:
jgarber
Message:

Fix handling of dots that start img src. Closes #49

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/ext/redcloth_scan/redcloth_inline.rl

    r290 r296  
    2424  # images 
    2525  image_src = ( uri ) >A %{ STORE(src) } ; 
    26   image_is = ( A2 C "."* image_src :> title? ) ; 
     26  image_is = ( A2 C ". "? image_src :> title? ) ; 
    2727  image_link = ( ":" uri >A %{ STORE_URL(href); } ) ; 
    2828  image = ( "["? "!" image_is "!" %A image_link? "]"? ) >X ; 
  • trunk/test/images.yml

    r272 r296  
    173173in:  (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10)  This is not. 
    174174html: <p>(This is an <a href="http://example.com/index.html?foo=bar&amp;a=b#a10"><img src="http://example.com/i/image.jpg" alt="" /></a>)  This is not.</p> 
     175--- 
     176name: image with relative src with dot 
     177in: "!../../image.jpg!" 
     178html: <p><img src="../../image.jpg" alt="" /></p> 
     179--- 
     180name: image with class 
     181in: "!(myclass)image.jpg!" 
     182html: <p><img src="image.jpg" class="myclass" alt="" /></p> 
     183--- 
     184name: image with class and dotspace 
     185in: "!(myclass). image.jpg!" 
     186html: <p><img src="image.jpg" class="myclass" alt="" /></p> 
     187--- 
     188name: image with class and relative src with dots 
     189in: "!(myclass)../../image.jpg!" 
     190html: <p><img src="../../image.jpg" class="myclass" alt="" /></p> 
     191--- 
     192name: image with class and dotspace and relative src with dots 
     193in: "!(myclass). ../../image.jpg!" 
     194html: <p><img src="../../image.jpg" class="myclass" alt="" /></p> 
     195--- 
     196name: image with style 
     197in: "!{color:red}image.jpg!" 
     198html: <p><img src="image.jpg" style="color:red;" alt="" /></p> 
     199--- 
     200name: image with style and dotspace 
     201in: "!{color:red}. image.jpg!" 
     202html: <p><img src="image.jpg" style="color:red;" alt="" /></p>