*
* @param html the HTML to check.
* @return true if the provided HTML string is complete.
*/
public static boolean isCompleteHtml(String html) {
HtmlParser htmlParser = HtmlParserFactory.createParser();
try {
htmlParser.parse(html);
} catch (ParseException e) {
return false;
}
return htmlParser.getState() == HtmlParser.STATE_TEXT
&& !htmlParser.inJavascript() && !htmlParser.inCss();
}