use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class HtmlSubsetDocumentBuilderXhtmlStrictTest method before.
@Before
public void before() {
writer = new StringWriter();
delegate = new HtmlDocumentBuilder(writer);
delegate.setEmitAsDocument(false);
builder = new HtmlSubsetDocumentBuilder(delegate);
builder.setSupportedBlockTypes(Sets.newHashSet(BlockType.PARAGRAPH, BlockType.DIV, BlockType.BULLETED_LIST, BlockType.LIST_ITEM, BlockType.QUOTE, BlockType.PREFORMATTED));
builder.setSupportedSpanTypes(Sets.newHashSet(SpanType.BOLD), Collections.<SpanHtmlElementStrategy>emptyList());
builder.setSupportedHeadingLevel(3);
builder.setXhtmlStrict(true);
builder.beginDocument();
}
use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class SubstitutionSpanStrategyTest method before.
@Before
public void before() {
writer = new StringWriter();
builder = new HtmlDocumentBuilder(writer);
builder.setEmitAsDocument(false);
}
use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class MarkdownLanguageParagraphBreakingBlocksDisabledTest method parseToHtml.
public String parseToHtml(String markup) {
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 stackOverflowWithLargeContentOnBug424387.
/**
* bug 424387
*/
@Test
public void stackOverflowWithLargeContentOnBug424387() throws IOException {
String content = Resources.toString(ConfluenceLanguageTest.class.getResource("resources/bug424387.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 testNote4.
@Test
public void testNote4() {
StringWriter out = new StringWriter();
HtmlDocumentBuilder builder = new HtmlDocumentBuilder(out);
builder.setUseInlineStyles(false);
parser.setBuilder(builder);
parser.parse("abc{note}this is a note {note}*bold* text\nfoo\n\nbar");
String html = out.toString();
assertTrue(html.contains("<body><p>abc</p><div class=\"note\"><p>this is a note </p></div><p><strong>bold</strong> text<br/>foo</p><p>bar</p></body>"));
}
Aggregations