
Accept parentheses in IMG alt/title and src
Reported by Paweł Gościcki | October 10th, 2008 @ 03:55 PM | in 4.1.9
The following produces unexpected result:
>> RedCloth.new("!image.jpg(Alt text with (round brackets). D'oh!)!").to_html
=> "<p>!image.jpg(Alt text with (round brackets). D’oh!)!</p>"
In 3.04 the above produced expected results (proper img tag).
This is partially related to ticket #23.
Comments and changes to this ticket
-
Paweł Gościcki October 11th, 2008 @ 06:14 AM
Temporary workaround:
text.gsub(/(\n\s*?\![^\n]+?\()([^\n]+?)(\)\!\s*?\n)/) { prefix = $1; inside = $2; suffix = $3; prefix + inside.gsub(/\(/, '(').gsub(/\)/, ')') + suffix }
-
Jason Garber February 12th, 2009 @ 03:38 PM
- State changed from new to hold
I took a look at this and it's too hard for me to implement now. I realize RedCloth 3.0.4 supported it, but since Textile 2 doesn't, I don't particularly feel I have to either. A patch would be most welcome, though!
-
Jason Garber February 12th, 2009 @ 06:52 PM
- State changed from hold to open
I'm implementing something similar for links, so I may as well do it for images.
-
Paweł Gościcki February 13th, 2009 @ 05:36 AM
Great! I was getting worried I'd be forced to use the gsub forever ;)
-
Jason Garber February 13th, 2009 @ 04:23 PM
- Milestone set to 4.1.9
- Title changed from ALT/TITLE attributes for images should accept round brackets as valid characters to Accept parentheses in IMG alt/title and src
About to commit the fix. This also fixes parentheses in image src.
-
Jason Garber February 13th, 2009 @ 04:27 PM
- State changed from open to resolved
(from [f6306a17bfc1afcfdd3f85809c7d63bde75e4c0a]) Fix image URLs and image titles so they can contain parentheses. [#71 state:resolved] http://github.com/jgarber/redclo...
-
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
-
71 Accept parentheses in IMG alt/title and src (from [f6306a17bfc1afcfdd3f85809c7d63bde75e4c0a]) Fix ima...
-
155 ALT description for images does not accept trailing whitespace I would expect it to generate a valid image tag. I suspec...