use of org.commonmark.renderer.html.HtmlNodeRendererFactory in project symja_android_library by axkr.
the class AJAXDocServlet method generateHTMLString.
public static String generateHTMLString(final String markdownStr) {
List<Extension> EXTENSIONS = //
Arrays.asList(TeXExtension.create(), TablesExtension.create());
Parser parser = //
Parser.builder().extensions(EXTENSIONS).build();
Node document = parser.parse(markdownStr);
HtmlRenderer renderer = //
HtmlRenderer.builder().extensions(EXTENSIONS).nodeRendererFactory(new HtmlNodeRendererFactory() {
@Override
public NodeRenderer create(HtmlNodeRendererContext context) {
return new DocNodeRenderer(context);
}
}).build();
return renderer.render(document);
}
Aggregations