Search in sources :

Example 6 with Template

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

the class TemplateProcessorTest method testBasicTemplateExcludedWithWildcards.

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

Example 7 with Template

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

the class TemplateProcessorTest method testBasicTemplateWithBrackets.

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

Example 8 with Template

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

the class TemplateProcessorTest method testBasicTemplateDidgitInTheName.

public void testBasicTemplateDidgitInTheName() {
    // Bug 380052
    Template template = new Template();
    template.setName("1stTest");
    template.setTemplateMarkup("first test");
    markupLanguage.getTemplates().add(template);
    TemplateProcessor templateProcessor = new TemplateProcessor(markupLanguage);
    String markup = templateProcessor.processTemplates("This is a {{1stTest}}.");
    assertEquals("This is a first test.", markup);
}
Also used : TemplateProcessor(org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor) Template(org.eclipse.mylyn.wikitext.mediawiki.Template)

Example 9 with Template

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

Example 10 with Template

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

Aggregations

Template (org.eclipse.mylyn.wikitext.mediawiki.Template)33 TemplateProcessor (org.eclipse.mylyn.wikitext.mediawiki.internal.TemplateProcessor)27 HashSet (java.util.HashSet)2 TemplateResolver (org.eclipse.mylyn.wikitext.mediawiki.TemplateResolver)2 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1