Display Malformed HTML "Safely?"

Posted by yar on Stack Overflow See other posts from Stack Overflow or by yar
Published on 2010-05-21T15:22:46Z Indexed on 2010/05/21 15:30 UTC
Read the original article Hit count: 222

Filed under:

Let's say I have some HTML like this:

<ol><li>a knock at the door, I'll be back in a second

which I display as inline HTML within a div that I produce. Is there any way to stop the inner, malformed HTML from screwing up the alignment of the entire document that comes after the HTML?

I realize that intelligently parsing it is one option (since I do have it on the server side), but I'm looking for a lighter solution.

© Stack Overflow or respective owner

Related posts about html