use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class CommonMarkLanguageTest method assertEvents.
private void assertEvents(String content, boolean asDocument, DocumentBuilderEvent... events) {
MarkupParser parser = new MarkupParser(language);
EventDocumentBuilder builder = new EventDocumentBuilder();
parser.setBuilder(builder);
parser.parse(content, asDocument);
List<DocumentBuilderEvent> expectedEvents = Arrays.asList(events);
List<DocumentBuilderEvent> actualEvents = builder.getDocumentBuilderEvents().getEvents();
assertEquals(format("Expected {0} but got {1}", toMessage(expectedEvents), toMessage(actualEvents)), expectedEvents, actualEvents);
}
use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class AsciiDocLanguageWithConfigurationIntegrationTest method parseWithImagesdirConfiguration.
@Test
public void parseWithImagesdirConfiguration() {
AsciiDocMarkupLanguageConfiguration configuration = new AsciiDocMarkupLanguageConfiguration();
Map<String, String> initialAttributes = new HashMap<>();
initialAttributes.put("imagesdir", "IMGS");
configuration.setInitialAttributes(initialAttributes);
MarkupParser parser = createParserWithConfiguration(configuration);
String markup = "See this the {imagesdir} folder";
String html = parseAsciiDocToHtml(markup, parser);
assertEquals("<p>See this the IMGS folder</p>\n", html);
}
use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class AsciiDocLanguageWithConfigurationIntegrationTest method parseWithEmptyConfiguration.
@Test
public void parseWithEmptyConfiguration() {
AsciiDocMarkupLanguageConfiguration configuration = new AsciiDocMarkupLanguageConfiguration();
MarkupParser parser = createParserWithConfiguration(configuration);
String html = parseAsciiDocToHtml(AsciiDocLanguageAttributeTest.MARKUP_FOR_DEFAULT, parser);
AsciiDocLanguageAttributeTest.ensureDefaultValues(html);
}
use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class HtmlLanguageIntegrationTest method emitImageWithoutImageSupport.
@Test
public void emitImageWithoutImageSupport() {
MarkupLanguage sourceLanguage = getDefaultMarkupLanguage("Source HTML");
MarkupLanguage targetLanguageWithNoImageSupport = getMarkupLanguageWithoutImageSupport("Target HTML With No Images");
StringWriter stringWriter = new StringWriter();
MarkupParser markupParser = getMarkupParser(sourceLanguage, targetLanguageWithNoImageSupport, stringWriter);
markupParser.parse("Text Before Image<img src=\"/favicon.ico\"/>Text After Image", false);
assertEquals("Text Before ImageText After Image", stringWriter.toString());
}
use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class MarkdownLanguageParagraphBreakingBlocksDisabledTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
parser = new MarkupParser(new Language());
}
Aggregations