use of org.eclipse.mylyn.wikitext.html.HtmlLanguage in project mylyn.docs by eclipse.
the class HtmlLanguageTest method cloneSupported.
@Test
public void cloneSupported() {
HtmlLanguage language = new HtmlLanguage();
HtmlLanguage cloned = language.clone();
assertNotNull(cloned);
assertEquals(language.getName(), cloned.getName());
}
use of org.eclipse.mylyn.wikitext.html.HtmlLanguage in project mylyn.docs by eclipse.
the class HtmlLanguageTest method parseCleansHtmlSetOnClone.
@Test
public void parseCleansHtmlSetOnClone() {
HtmlLanguage htmlLanguage = new HtmlLanguage();
htmlLanguage.setParseCleansHtml(true);
assertEquals(htmlLanguage.isParseCleansHtml(), htmlLanguage.clone().isParseCleansHtml());
htmlLanguage.setParseCleansHtml(false);
assertEquals(htmlLanguage.isParseCleansHtml(), htmlLanguage.clone().isParseCleansHtml());
}
use of org.eclipse.mylyn.wikitext.html.HtmlLanguage in project mylyn.docs by eclipse.
the class HtmlLanguageTest method assertProcessContent.
protected void assertProcessContent(String expectedHtml, String sourceHtml, boolean asDocument, boolean parseCleansHtml) {
Writer out = new StringWriter();
HtmlDocumentBuilder builder = new HtmlDocumentBuilder(out);
HtmlLanguage language = new HtmlLanguage();
language.setParseCleansHtml(parseCleansHtml);
MarkupParser markupParser = new MarkupParser(language, builder);
markupParser.parse(sourceHtml, asDocument);
assertEquals(expectedHtml, out.toString());
}
use of org.eclipse.mylyn.wikitext.html.HtmlLanguage in project mylyn.docs by eclipse.
the class HtmlLanguageTest method newDocumentBuilder.
@Test
public void newDocumentBuilder() {
Writer out = new StringWriter();
DocumentBuilder builder = new HtmlLanguage().createDocumentBuilder(out);
assertNotNull(builder);
assertTrue(builder instanceof HtmlDocumentBuilder);
}
use of org.eclipse.mylyn.wikitext.html.HtmlLanguage in project mylyn.docs by eclipse.
the class ConfluenceLanguageIntegrationTest method assertHtmlToConfluence.
private void assertHtmlToConfluence(boolean parseAsDocument) {
HtmlLanguage htmlLanguage = HtmlLanguage.builder().add(BlockType.PARAGRAPH).add(SpanType.BOLD).name("Test").create();
MarkupParser parser = new MarkupParser(htmlLanguage);
Writer confluenceOut = new StringWriter();
DocumentBuilder confuenceBuilder = new ConfluenceLanguage().createDocumentBuilder(confluenceOut);
parser.setBuilder(confuenceBuilder);
parser.parse("<html><body>some text <b>bold here</b> more text</body></html>", parseAsDocument);
assertEquals("some text *bold here* more text\n\n", confluenceOut.toString());
}
Aggregations