use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class MarkupToEclipseHelpMojoTest method embeddedTableOfContents.
@Test
public void embeddedTableOfContents() {
HtmlDocumentBuilder builder = mock(HtmlDocumentBuilder.class);
SplitOutlineItem item = mock(SplitOutlineItem.class);
File htmlOutputFile = mock(File.class);
SplittingHtmlDocumentBuilder splittingBuilder = markupToEclipseHelp.createSplittingBuilder(builder, item, htmlOutputFile, "");
assertFalse(splittingBuilder.isEmbeddedTableOfContents());
markupToEclipseHelp.embeddedTableOfContents = true;
splittingBuilder = markupToEclipseHelp.createSplittingBuilder(builder, item, htmlOutputFile, "");
assertTrue(splittingBuilder.isEmbeddedTableOfContents());
}
use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class MarkupToEclipseHelpMojoTest method assertNavigationImagesPath.
private void assertNavigationImagesPath(String expected, String relativePath) {
HtmlDocumentBuilder builder = mock(HtmlDocumentBuilder.class);
SplitOutlineItem item = mock(SplitOutlineItem.class);
SplittingHtmlDocumentBuilder splittingBuilder = markupToEclipseHelp.createSplittingBuilder(builder, item, mock(File.class), relativePath);
assertEquals(expected, splittingBuilder.getNavigationImagePath());
}
use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class TextileLanguageTest method testBug50NoXHTMLCompliance.
@Test
public void testBug50NoXHTMLCompliance() throws Exception {
StringWriter writer = new StringWriter();
MarkupParser parser = new MarkupParser(new TextileLanguage());
final HtmlDocumentBuilder builder = new HtmlDocumentBuilder(writer);
builder.setXhtmlStrict(false);
builder.setEmitDtd(false);
parser.setBuilder(builder);
parser.parse("!<image.png!:http://foo.bar");
String html = writer.toString();
assertTrue(html.contains("<a href=\"http://foo.bar\"><img align=\"left\" border=\"0\" src=\"image.png\"/></a>"));
}
use of org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder in project mylyn.docs by eclipse.
the class TextileLanguageDefinitionListTest method parseToHtml.
private 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 AbstractMarkupGenerationTest method toHtml.
protected String toHtml(String markup) {
Writer writer = new StringWriter();
HtmlDocumentBuilder builder = new HtmlDocumentBuilder(writer);
builder.setEmitAsDocument(false);
parser.setBuilder(builder);
parser.parse(markup);
return writer.toString();
}
Aggregations