use of org.eclipse.mylyn.wikitext.mediawiki.Template 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.Template 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.Template 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);
}
use of org.eclipse.mylyn.wikitext.mediawiki.Template in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateWithSlashes.
public void testBasicTemplateWithSlashes() {
// Bug 468237
Template template = new Template();
template.setName("Temp/Main");
template.setTemplateMarkup("_expanded_");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("one {{Temp/Main}} two");
assertEquals("one _expanded_ two", markup);
}
use of org.eclipse.mylyn.wikitext.mediawiki.Template in project mylyn.docs by eclipse.
the class TemplateProcessorTest method testBasicTemplateDidgitInTheName3.
public void testBasicTemplateDidgitInTheName3() {
// Bug 380052
Template template = new Template();
template.setName("foo999bar");
template.setTemplateMarkup("foo-bar");
markupLanguage.getTemplates().add(template);
TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
String markup = templateProcessor.processTemplates("foo{{foo999bar}}bar");
assertEquals("foofoo-barbar", markup);
}
Aggregations