
Allow space in image tag?
Reported by Bil Kleb | March 11th, 2009 @ 03:53 AM
Redcloth 3.0.4 allows whitespace between the image file name and the caption, viz
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> gem 'RedCloth', '=3.0.4'
=> true
irb(main):003:0> require 'redcloth'
=> true
irb(main):004:0> RedCloth.new('!file.jpg (Caption)!').to_html
=> "<p><img src=\"file.jpg\" title=\"Caption\" alt=\"Caption\" /></p>"
whereas RedCloth 4.1.8 does not,
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> gem 'RedCloth', '=4.1.9'
=> true
irb(main):003:0> require 'redcloth'
=> true
irb(main):004:0> RedCloth.new('!file.jpg (Caption)!').to_html
=> "<p>!file.jpg (Caption)!</p>"
Comments and changes to this ticket
-
Jason Garber March 17th, 2009 @ 04:45 AM
- Milestone set to 4.2.0
- State changed from new to open
-
Jason Garber May 26th, 2009 @ 11:59 PM
Tried to fix it, but when I allow a space between the two, then some tests fail
My test:
--- name: with space before alt text description: RedCloth 3.0.4 allowed spaces between image URL and alt text in: This is an !image.jpg (with alt text)!. html: <p>This is an <img src="image.jpg" title="with alt text" alt="with alt text" />.</p>
That passes, but then these fail.
HTML should output html for images 56 HTML should output html for images 57 HTML should output html for images with link in square brackets HTML should output html for images 48 HTML should output html for images 49 HTML should output html for images 50 HTML should output html for images 51 HTML should output html for images 52 HTML should output html for images 53 HTML should output html for images 54 HTML should output html for images 55
Not sure how to fix it all.
-
Jason Garber June 3rd, 2009 @ 08:12 AM
- Tag changed from backward compatibility, formatters, images to backward compatibility, difficult, formatters, images
-
Jason Garber June 7th, 2009 @ 06:24 AM
- Milestone cleared.
I just can't figure this one out. Dropping from the milestone.
-
Nicholas Rutherford June 4th, 2010 @ 04:03 PM
It also skips when a space is in the image name, e.g. !/system/images/Picture 1.png! will not be converted to an img but !/system/images/Picture%201.png! will.
Yes, those are Paperclip paths, it doesn't url_encode the filename and that works fine with rails helpers like image_tag.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
RedCloth is a Ruby library for converting Textile into HTML
People watching this ticket
Referenced by
-
155 ALT description for images does not accept trailing whitespace And note that this bug is different than #122.