use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class DitaTopicDocumentBuilderTest method testNoFormatting.
public void testNoFormatting() {
parser = new MarkupParser();
parser.setMarkupLanguage(new TextileLanguage());
out = new StringWriter();
DefaultXmlStreamWriter xmlStreamWriter = new DefaultXmlStreamWriter(out);
builder = new DitaTopicDocumentBuilder(xmlStreamWriter, false);
parser.setBuilder(builder);
parser.parse("h1. Title1\n\nsome content in a para");
xmlStreamWriter.close();
String dita = out.toString();
assertTrue(dita.contains("<topic id=\"Title1\"><title>Title1</title><body><p>some content in a para</p></body></topic>"));
}
use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class DitaTopicDocumentBuilderTest method setUp.
@Override
public void setUp() {
parser = new MarkupParser();
parser.setMarkupLanguage(new TextileLanguage());
out = new StringWriter();
builder = new DitaTopicDocumentBuilder(out);
parser.setBuilder(builder);
}
use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class DocBookDocumentBuilderIntegrationTest method setUp.
@Override
public void setUp() {
parser = new MarkupParser();
parser.setMarkupLanguage(new TextileLanguage());
out = new StringWriter();
builder = new DocBookDocumentBuilder(out);
parser.setBuilder(builder);
}
use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class AbstractSaxParserTest method performTest.
protected void performTest(String html, String expectedResult) throws IOException, SAXException {
parser.parse(sourceForHtml(html), builder, true);
String generatedMarkup = out.toString();
assertEquals(expectedResult, generatedMarkup);
MarkupParser markupParser = new MarkupParser(new TextileLanguage());
StringWriter out = new StringWriter();
HtmlDocumentBuilder htmlBuilder = new HtmlDocumentBuilder(out);
htmlBuilder.setEmitAsDocument(false);
markupParser.setBuilder(htmlBuilder);
markupParser.parse(generatedMarkup);
}
use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class TextileLanguageTest method testBug50XHTMLCompliance.
@Test
public void testBug50XHTMLCompliance() throws Exception {
StringWriter writer = new StringWriter();
MarkupParser parser = new MarkupParser(new TextileLanguage());
final HtmlDocumentBuilder builder = new HtmlDocumentBuilder(writer);
builder.setXhtmlStrict(true);
builder.setEmitDtd(true);
builder.setHtmlDtd("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
parser.setBuilder(builder);
parser.parse("!<image.png!:http://foo.bar");
String html = writer.toString();
assertTrue(html.contains("<a href=\"http://foo.bar\"><img style=\"border-width: 0px;text-align: left;\" alt=\"\" src=\"image.png\"/></a>"));
}
Aggregations