Hpricot: Stop auto fixing HTML

Posted by Imran on Stack Overflow See other posts from Stack Overflow or by Imran
Published on 2011-03-15T12:05:36Z Indexed on 2011/03/16 0:10 UTC
Read the original article Hit count: 199

Filed under:
|
|
|
|

Consider the following example (sample data):

doc = Hpricot("<a><table><tr><td>LOREM IPSUM</td></tr></table></a>")

it converts it to

<a></a><table><tr><td>LOREM IPSUM</td></tr></table>

What it actually do is, pull out the table from <a> tag.

I think Hpricot tries to repair the HTML. How can I stop Hpricot doing this?

© Stack Overflow or respective owner

Related posts about html

Related posts about ruby