Search in sources :

Example 1 with AutoLinkSwitchPhraseModifier

use of org.eclipse.mylyn.wikitext.twiki.internal.phrase.AutoLinkSwitchPhraseModifier in project mylyn.docs by eclipse.

the class TWikiLanguage method addStandardPhraseModifiers.

@Override
protected void addStandardPhraseModifiers(PatternBasedSyntax phraseModifierSyntax) {
    // IMPORTANT NOTE: Most items below have order dependencies.  DO NOT REORDER ITEMS BELOW!!
    boolean escapingHtml = configuration == null ? false : configuration.isEscapingHtmlAndXml();
    phraseModifierSyntax.add(new AutoLinkSwitchPhraseModifier());
    if (!escapingHtml) {
        phraseModifierSyntax.add(new HtmlStartTagPhraseModifier());
        phraseModifierSyntax.add(new HtmlEndTagPhraseModifier());
    }
    // $NON-NLS-1$
    phraseModifierSyntax.beginGroup("(?:(?<=[\\s\\.,\\\"'?!;:\\)\\(\\{\\}\\[\\]])|^)(?:", 0);
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("*", SpanType.BOLD));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("__", new SpanType[] { SpanType.BOLD, SpanType.ITALIC }));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("_", SpanType.ITALIC));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("==", new SpanType[] { SpanType.BOLD, SpanType.MONOSPACE }));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("=", SpanType.MONOSPACE));
    // $NON-NLS-1$
    phraseModifierSyntax.endGroup(")(?=\\W|$)", 0);
    literalPhraseModifierSyntax.add(new HtmlStartTagPhraseModifier());
    literalPhraseModifierSyntax.add(new HtmlEndTagPhraseModifier());
}
Also used : SpanType(org.eclipse.mylyn.wikitext.parser.DocumentBuilder.SpanType) AutoLinkSwitchPhraseModifier(org.eclipse.mylyn.wikitext.twiki.internal.phrase.AutoLinkSwitchPhraseModifier) SimplePhraseModifier(org.eclipse.mylyn.wikitext.twiki.internal.phrase.SimplePhraseModifier) HtmlEndTagPhraseModifier(org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlEndTagPhraseModifier) HtmlStartTagPhraseModifier(org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlStartTagPhraseModifier)

Aggregations

SpanType (org.eclipse.mylyn.wikitext.parser.DocumentBuilder.SpanType)1 HtmlEndTagPhraseModifier (org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlEndTagPhraseModifier)1 HtmlStartTagPhraseModifier (org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlStartTagPhraseModifier)1 AutoLinkSwitchPhraseModifier (org.eclipse.mylyn.wikitext.twiki.internal.phrase.AutoLinkSwitchPhraseModifier)1 SimplePhraseModifier (org.eclipse.mylyn.wikitext.twiki.internal.phrase.SimplePhraseModifier)1