#147 open
David Cato

Can't have multiple HTML block tags (table, tr, td) on same line

Reported by David Cato | May 15th, 2009 @ 10:04 PM

Given

<table><tr><td>Foo</td></tr></table>

#to_html generates spurious p tags

<table><tr><td>Foo</td><p></tr></table></p>

If, however, a newline is inserted before the closing table tag (or a newline + space, but not a newline by itself, is inserted before the closing tr tag), then the extra p tags are not inserted.

Tested with both RedCloth 4.1.9 and the current (as of 2009-05-15) version on github.

Comments and changes to this ticket

  • Jason Garber

    Jason Garber June 3rd, 2009 @ 08:08 AM

    • State changed from “new” to “open”

    Yeah, that's a problem. Right now you just have to have one block tag (TABLE, TR, TD) per line. So this would work fine.

    <table>
      <tr>
        <td>Food</td>
      </tr>
    </table>
    

    The problem is the scanner isn't a sophisticated HTML parser. If it sees an opening block HTML tag, it pops into a separate HTML machine and exits when it encounters any closing block HTML tag.

  • Jason Garber

    Jason Garber June 3rd, 2009 @ 08:09 AM

    • Title changed from “</table> error if not preceeded by newline” to “Can't have multiple HTML block tags (table, tr, td) on same line”
    • Tag changed from newlines, to_html to difficult, newlines, to_html
  • Jason Garber

    Jason Garber June 7th, 2009 @ 06:26 AM

    • Milestone cleared.

    Not going to figure this one out any time soon.

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

Pages