use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentHandler in project mylyn.docs by eclipse.
the class HtmlSubsetLanguageTest method cloneSupported.
@Test
public void cloneSupported() {
HtmlDocumentHandler documentHandler = new HtmlDocumentHandler() {
@Override
public void endDocument(HtmlDocumentBuilder builder, XmlStreamWriter writer) {
// ignore
}
@Override
public void beginDocument(HtmlDocumentBuilder builder, XmlStreamWriter writer) {
// ignore
}
};
HtmlSubsetLanguage language = new HtmlSubsetLanguage("Test", documentHandler, 6, Sets.newHashSet(BlockType.PARAGRAPH, BlockType.DIV, BlockType.QUOTE), Sets.newHashSet(SpanType.CITATION, SpanType.EMPHASIS), ImmutableMap.of(SpanType.EMPHASIS, "new-em"), Collections.<SpanHtmlElementStrategy>emptyList(), false, true);
HtmlSubsetLanguage cloned = language.clone();
assertEquals(language.getName(), cloned.getName());
assertEquals(language.getSupportedBlockTypes(), cloned.getSupportedBlockTypes());
assertEquals(language.getSupportedHeadingLevel(), cloned.getSupportedHeadingLevel());
assertEquals(language.getSupportedSpanTypes(), cloned.getSupportedSpanTypes());
assertEquals(language.getTagNameSubstitutions(), cloned.getTagNameSubstitutions());
}
use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentHandler 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