use of org.eclipse.mylyn.wikitext.parser.MarkupParser 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.MarkupParser in project mylyn.docs by eclipse.
the class ServiceLocatorTest method getAllMarkupLanguagesFiltersDuplicates.
@Test
public void getAllMarkupLanguagesFiltersDuplicates() {
final MarkupLanguage language1 = new TestMarkupLanguage("Language 1");
final MarkupLanguage language1b = new MarkupLanguage() {
{
setName("Language 1");
}
@Override
public void processContent(MarkupParser parser, String markupContent, boolean asDocument) {
throw new IllegalStateException();
}
};
final MarkupLanguage language2 = new TestMarkupLanguage("Language 3");
final MarkupLanguage language2b = new TestMarkupLanguage("Language 3");
ServiceLocator locator = new ServiceLocator(ServiceLocatorTest.class.getClassLoader()) {
@Override
void loadMarkupLanguages(MarkupLanguageVisitor visitor) {
visitor.accept(language1);
visitor.accept(language1b);
visitor.accept(language2);
visitor.accept(language2b);
}
};
Set<MarkupLanguage> markupLanguages = locator.getAllMarkupLanguages();
assertEquals(3, markupLanguages.size());
assertTrue(markupLanguages.containsAll(ImmutableSet.of(language1, language1b)));
assertTrue(markupLanguages.contains(language2) || markupLanguages.contains(language2b));
}
use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class TextileLanguageTasksTest method initParser.
private void initParser() throws IOException {
parser = new MarkupParser();
markupLanguage = new TextileLanguage();
MarkupLanguageConfiguration configuration = Util.create("bugzilla");
markupLanguage.configure(configuration);
parser.setMarkupLanguage(markupLanguage);
}
use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class TracWikiLanguageTest method setUp.
@Override
public void setUp() {
markupLanguage = new TracWikiLanguage();
parser = new MarkupParser(markupLanguage);
}
use of org.eclipse.mylyn.wikitext.parser.MarkupParser in project mylyn.docs by eclipse.
the class AbstractMarkupGenerationTest method initParser.
@Before
public void initParser() {
parser = new MarkupParser();
markupLanguage = createMarkupLanguage();
parser.setMarkupLanguage(markupLanguage);
}
Aggregations