use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateNoNamespace.
public void testBasicTemplateNoNamespace() {
// Bug 468237
Template template = new Template();
template.setName(":Test");
template.setTemplateMarkup("_expanded_");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{:Test}} two");
assertEquals("one _expanded_ two", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateNoInclude.
public void testBasicTemplateNoInclude() {
Template template = new Template();
template.setName("test");
template.setTemplateMarkup("<noinclude>foo bar baz\n</noinclude>_expanded_");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{test}} two");
assertEquals("one _expanded_ two", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateNamedParameter_DefaultValue.
public void testBasicTemplateNamedParameter_DefaultValue() {
Template template = new Template();
template.setName("test");
template.setTemplateMarkup("_expanded{{{message|default value}}}_");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{test}} two");
assertEquals("one _expandeddefault value_ two", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateNoParametersRecLoopDetection.
public void testBasicTemplateNoParametersRecLoopDetection() {
// Bug 379783
Template templateMer = new Template();
templateMer.setName("mer");
templateMer.setTemplateMarkup("�test{{mer}}test�");
markupLanguage.getTemplates().add(templateMer);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("{{mer}}");
assertEquals("�test<span class=\"error\">Template loop detected:mer</span>test�", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplatePositionalParameterWithSpaces.
public void testBasicTemplatePositionalParameterWithSpaces() {
Template template = new Template();
template.setName("Note");
template.setTemplateMarkup("<p class='note'>{{{1}}}</p>");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{Note|comment with spaces.}} two");
assertEquals("one <p class='note'>comment with spaces.</p> two", markup);
}
Aggregations