use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class AsciiDocLanguageTestBase method parseAsciiDocToHtml.
protected static String parseAsciiDocToHtml(String markup, MarkupParser parser) {
StringWriter out = new StringWriter();
HtmlDocumentBuilder builder = new HtmlDocumentBuilder(out);
builder.setEmitAsDocument(false);
parser.setBuilder(builder);
parser.parse(markup);
return out.toString();
}
use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class ConfluenceLanguageTest method testHyperlinkMailtoWithBase.
@Test
public void testHyperlinkMailtoWithBase() throws URISyntaxException {
StringWriter out = new StringWriter();
HtmlDocumentBuilder builder = new HtmlDocumentBuilder(out);
builder.setBase(new URI("/"));
parser.setBuilder(builder);
parser.parse("[test|mailto:foo@bar.com]");
assertTrue(out.toString().contains("<a href=\"mailto:foo@bar.com\">test</a>"));
}
use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class ConfluenceLanguageTest method testHangOnBug318695.
/**
* bug 318695
*/
@Test
public void testHangOnBug318695() throws IOException {
String content = Resources.toString(ConfluenceLanguageTest.class.getResource("resources/bug318695.confluence"), Charsets.UTF_8);
parser.setBuilder(new HtmlDocumentBuilder(new StringWriter()));
parser.parse(new StringReader(content));
// if we reach here we didn't hang.
}
use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class ConfluenceLanguageTest method testHyperlinkMailtoNoBase.
@Test
public void testHyperlinkMailtoNoBase() {
StringWriter out = new StringWriter();
HtmlDocumentBuilder builder = new HtmlDocumentBuilder(out);
builder.setBase(null);
parser.setBuilder(builder);
parser.parse("[test|mailto:foo@bar.com]");
assertTrue(out.toString().contains("<a href=\"mailto:foo@bar.com\">test</a>"));
}
use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class ConfluenceLanguageTest method testNote3.
@Test
public void testNote3() {
StringWriter out = new StringWriter();
HtmlDocumentBuilder builder = new HtmlDocumentBuilder(out);
builder.setUseInlineStyles(false);
parser.setBuilder(builder);
parser.parse("{note}this is a note {note}*bold* text\nfoo\n\nbar");
String html = out.toString();
assertTrue(html.contains("<body><div class=\"note\"><p>this is a note </p></div><p><strong>bold</strong> text<br/>foo</p><p>bar</p></body>"));
}
Aggregations