Retrieving well formed HTML using Jericho HTML parser in Java
Posted
by Raj
on Stack Overflow
See other posts from Stack Overflow
or by Raj
Published on 2010-04-12T15:13:37Z
Indexed on
2010/04/12
15:33 UTC
Read the original article
Hit count: 656
Hello, I've looked at jTidy for converting a snipped of malformed/real-world HTML into well-formed HTML/XHTML. However, there's a bug in the latest version due to which I'm not able to use it. I'm looking at Jericho since it has a lot of positive reviews around the net.
However, its not immediately obvious to me how one would go about implementing a method like:
public String getValidHTML(String messedUpHTML)
For instance, if it was passed <div>bar
, it would return <div>bar</div>
Any pointers would be helpful.
Thanks in advance!
© Stack Overflow or respective owner