use of org.attoparser.markup.MarkupAttoParser in project xp by enonic.
the class HtmlBlockParser method parse.
public HtmlBlocks parse(final String html) {
this.currentBlock = new StringBuilder();
this.htmlBlocks = HtmlBlocks.builder();
try {
final MarkupAttoParser parser = new MarkupAttoParser();
parser.parse(html, new HtmlBlockParseAttoHandler(this));
addStaticHtml();
return this.htmlBlocks.build();
} catch (final AttoParseException e) {
final Throwable cause = e.getCause();
if (cause instanceof RuntimeException) {
throw (RuntimeException) cause;
}
throw new RenderException("Failed to post process document", cause != null ? cause : e);
}
}
Aggregations