Search in sources :

Example 1 with MonospacePhraseModifier

use of org.eclipse.mylyn.wikitext.tracwiki.internal.phrase.MonospacePhraseModifier in project mylyn.docs by eclipse.

the class TracWikiLanguage method addStandardPhraseModifiers.

@Override
protected void addStandardPhraseModifiers(PatternBasedSyntax phraseModifierSyntax) {
    // IMPORTANT NOTE: Most items below have order dependencies.  DO NOT REORDER ITEMS BELOW!!
    phraseModifierSyntax.add(new MonospacePhraseModifier());
    // always starts at the start of a line or after a non-word character excluding '!' and '-' //$NON-NLS-1$
    phraseModifierSyntax.beginGroup("(?:(?<=[\\s\\.\\\"'?!;:\\)\\(\\{\\}\\[\\]-])|^)(?:", 0);
    phraseModifierSyntax.add(new EscapePhraseModifier());
    phraseModifierSyntax.add(new // $NON-NLS-1$
    SimplePhraseModifier(// $NON-NLS-1$
    "'''''", // $NON-NLS-1$
    new SpanType[] { SpanType.BOLD, SpanType.ITALIC }, true));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("'''", SpanType.BOLD, true));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("''", SpanType.ITALIC, true));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("__", SpanType.UNDERLINED, true));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("~~", SpanType.DELETED, true));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("^", SpanType.SUPERSCRIPT, true));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier(",,", SpanType.SUBSCRIPT, true));
    // $NON-NLS-1$
    phraseModifierSyntax.endGroup(")(?=\\W|$)", 0);
}
Also used : SpanType(org.eclipse.mylyn.wikitext.parser.DocumentBuilder.SpanType) MonospacePhraseModifier(org.eclipse.mylyn.wikitext.tracwiki.internal.phrase.MonospacePhraseModifier) EscapePhraseModifier(org.eclipse.mylyn.wikitext.tracwiki.internal.phrase.EscapePhraseModifier) SimplePhraseModifier(org.eclipse.mylyn.wikitext.tracwiki.internal.phrase.SimplePhraseModifier)

Aggregations

SpanType (org.eclipse.mylyn.wikitext.parser.DocumentBuilder.SpanType)1 EscapePhraseModifier (org.eclipse.mylyn.wikitext.tracwiki.internal.phrase.EscapePhraseModifier)1 MonospacePhraseModifier (org.eclipse.mylyn.wikitext.tracwiki.internal.phrase.MonospacePhraseModifier)1 SimplePhraseModifier (org.eclipse.mylyn.wikitext.tracwiki.internal.phrase.SimplePhraseModifier)1