use of org.eclipse.mylyn.wikitext.commonmark.internal.spec.SimplifiedHtmlDocumentBuilder in project mylyn.docs by eclipse.
the class AbstractSourceSpanTest method assertParseToHtml.
public void assertParseToHtml(String expected, String markup) {
StringWriter writer = new StringWriter();
HtmlDocumentBuilder builder = new SimplifiedHtmlDocumentBuilder(writer);
builder.setEmitAsDocument(false);
builder.beginDocument();
InlineParser parser = new InlineParser(span, new AllCharactersSpan());
List<Inline> inlines = parser.parse(ProcessingContext.builder().build(), new TextSegment(ImmutableList.of(new Line(1, 0, markup))));
for (Inline inline : inlines) {
inline.emit(builder);
}
builder.endDocument();
assertEquals(expected, writer.toString());
}
use of org.eclipse.mylyn.wikitext.commonmark.internal.spec.SimplifiedHtmlDocumentBuilder in project mylyn.docs by eclipse.
the class CommonMarkAsserts method createDocumentBuilder.
private static DocumentBuilder createDocumentBuilder(StringWriter out) {
HtmlDocumentBuilder builder = new SimplifiedHtmlDocumentBuilder(out);
builder.setDocumentHandler(new HtmlDocumentHandler() {
@Override
public void endDocument(HtmlDocumentBuilder builder, XmlStreamWriter writer) {
}
@Override
public void beginDocument(HtmlDocumentBuilder builder, XmlStreamWriter writer) {
}
});
return builder;
}
Aggregations