use of org.eclipse.mylyn.wikitext.html.internal.HtmlSubsetLanguage in project mylyn.docs by eclipse.
the class HtmlLanguageBuilderTest method document.
@Test
public void document() {
HtmlSubsetLanguage subsetLanguage = (HtmlSubsetLanguage) builder.add(BlockType.PARAGRAPH).document("<div>", "</div>").name("Test").create();
StringWriter writer = new StringWriter();
DocumentBuilder documentBuilder = subsetLanguage.createDocumentBuilder(writer);
documentBuilder.beginDocument();
documentBuilder.characters("test");
documentBuilder.endDocument();
assertEquals("<div>test</div>", writer.toString());
}
use of org.eclipse.mylyn.wikitext.html.internal.HtmlSubsetLanguage in project mylyn.docs by eclipse.
the class HtmlLanguageBuilderTest method create.
@Test
public void create() {
HtmlLanguage language = builder.add(BlockType.PARAGRAPH).add(BlockType.CODE).add(SpanType.SUPERSCRIPT).add(SpanType.BOLD).addSubstitution(SpanType.BOLD, "bold").name("Test").create();
assertNotNull(language);
assertEquals("Test", language.getName());
assertTrue(language instanceof HtmlSubsetLanguage);
HtmlSubsetLanguage subsetLanguage = (HtmlSubsetLanguage) language;
assertEquals(ImmutableSet.of(BlockType.PARAGRAPH, BlockType.CODE), subsetLanguage.getSupportedBlockTypes());
assertEquals(ImmutableSet.of(SpanType.SUPERSCRIPT, SpanType.BOLD), subsetLanguage.getSupportedSpanTypes());
assertEquals(0, subsetLanguage.getSupportedHeadingLevel());
}
use of org.eclipse.mylyn.wikitext.html.internal.HtmlSubsetLanguage in project mylyn.docs by eclipse.
the class HtmlLanguageBuilderTest method assertXhtmlStrict.
private void assertXhtmlStrict(boolean xhtmlStrict) {
builder.name("Test").add(BlockType.PARAGRAPH);
assertSame(builder, builder.setXhtmlStrict(xhtmlStrict));
HtmlSubsetLanguage language = (HtmlSubsetLanguage) builder.create();
assertEquals(xhtmlStrict, language.isXhtmlStrict());
}
use of org.eclipse.mylyn.wikitext.html.internal.HtmlSubsetLanguage in project mylyn.docs by eclipse.
the class HtmlLanguageBuilderTest method assertSupportsImages.
private void assertSupportsImages(boolean supportsImages) {
builder.name("Test").add(BlockType.PARAGRAPH);
assertSame(builder, builder.setSupportsImages(supportsImages));
HtmlSubsetLanguage language = (HtmlSubsetLanguage) builder.create();
assertEquals(supportsImages, language.getSupportsImages());
}
use of org.eclipse.mylyn.wikitext.html.internal.HtmlSubsetLanguage in project mylyn.docs by eclipse.
the class HtmlLanguageBuilderTest method addHeadingsCreatesExpectedSupportLevel.
@Test
public void addHeadingsCreatesExpectedSupportLevel() {
HtmlSubsetLanguage subsetLanguage = (HtmlSubsetLanguage) builder.add(BlockType.PARAGRAPH).addHeadings(3).name("Test").create();
assertEquals(3, subsetLanguage.getSupportedHeadingLevel());
}
Aggregations