Search in sources :

Example 11 with TemplateProcessor

use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor 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);
}
Also used : TemplateProcessor(org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor) Template(org.eclipse.mylyn.wikitext.mediawiki.Template)

Example 12 with TemplateProcessor

use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor 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);
}
Also used : TemplateProcessor(org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor) Template(org.eclipse.mylyn.wikitext.mediawiki.Template)

Example 13 with TemplateProcessor

use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.

the class TemplateProcessorTest method testBasicTemplateQualifiedName.

public void testBasicTemplateQualifiedName() {
    Template template = new Template();
    template.setName("Test:test");
    template.setTemplateMarkup("_expanded_");
    markupLanguage.getTemplates().add(template);
    TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
    String markup = templateProcessor.processTemplates("one {{Test:test}} two");
    assertEquals("one _expanded_ two", markup);
}
Also used : TemplateProcessor(org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor) Template(org.eclipse.mylyn.wikitext.mediawiki.Template)

Example 14 with TemplateProcessor

use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.

the class TemplateProcessorTest method testBasicTemplateNoParameters.

public void testBasicTemplateNoParameters() {
    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);
}
Also used : TemplateProcessor(org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor) Template(org.eclipse.mylyn.wikitext.mediawiki.Template)

Example 15 with TemplateProcessor

use of org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor in project mylyn.docs by eclipse.

the class TemplateProcessorTest method testBasicTemplateOtherNamespace.

public void testBasicTemplateOtherNamespace() {
    // Bug 468237
    Template template = new Template();
    template.setName("Other:Test");
    template.setTemplateMarkup("_expanded_");
    markupLanguage.getTemplates().add(template);
    TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
    String markup = templateProcessor.processTemplates("one {{Other:Test}} two");
    assertEquals("one _expanded_ two", markup);
}
Also used : TemplateProcessor(org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor) Template(org.eclipse.mylyn.wikitext.mediawiki.Template)

Aggregations

TemplateProcessor (org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor)28 Template (org.eclipse.mylyn.wikitext.mediawiki.Template)27 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 MediaWikiLanguage (org.eclipse.mylyn.wikitext.mediawiki.MediaWikiLanguage)1 TemplateResolver (org.eclipse.mylyn.wikitext.mediawiki.TemplateResolver)1