#87 ✓resolved
Jarkko Laine

RedCloth 4 encloses </object> within a paragraph

Reported by Jarkko Laine | November 16th, 2008 @ 08:13 PM

This is a really weird bug that seems to affect both 4.1 and 4.0.3 but not 3.0.1.


>> rc = RedCloth.new(c.add_youtube(str))
=> "<p><object width=\"340\" height=\"280\"><param name=\"movie\" value=\"http://www.youtube.com/v/iUbK1cBHm6E\"></param><param name=\"wmode\" value=\"opaque\"></param><param name=\"allowScriptAccess\" value=\"sameDomain\"></param><embed src=\"http://www.youtube.com/v/iUbK1cBHm6E\" type=\"application/x-shockwave-flash\" width=\"340\" height=\"280\" wmode=\"opaque\" allowScriptAccess=\"sameDomain\"></embed></object></p>"
>> rc.to_html
=> "<p><object width=\"340\" height=\"280\"><param name=\"movie\" value=\"http://www.youtube.com/v/iUbK1cBHm6E\"></param><param name=\"wmode\" value=\"opaque\"></param><param name=\"allowScriptAccess\" value=\"sameDomain\"></param><embed src=\"http://www.youtube.com/v/iUbK1cBHm6E\" type=\"application/x-shockwave-flash\" width=\"340\" height=\"280\" wmode=\"opaque\" allowScriptAccess=\"sameDomain\"></embed><p></object></p></p>"

Note how to_html puts the closing tag within another p element (thus creating invalid html) even though there is no line break or anything (or even whitespace) around the object tag.

I just noticed since one of our tests started breaking with RedCloth 4.

Comments and changes to this ticket

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.

New-ticket Create new ticket

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

Shared Ticket Bins

People watching this ticket

Tags

Referenced by

Pages