Search in sources :

Example 1 with HtmlStartTagPhraseModifier

use of org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlStartTagPhraseModifier in project mylyn.docs by eclipse.

the class TextileLanguage method addStandardPhraseModifiers.

@Override
protected void addStandardPhraseModifiers(PatternBasedSyntax phraseModifierSyntax) {
    boolean escapingHtml = configuration == null ? false : configuration.isEscapingHtmlAndXml();
    phraseModifierSyntax.add(new TagEscapeTextilePhraseModifier());
    phraseModifierSyntax.add(new HtmlEndTagPhraseModifier(escapingHtml));
    phraseModifierSyntax.add(new HtmlStartTagPhraseModifier(escapingHtml));
    // $NON-NLS-1$
    phraseModifierSyntax.beginGroup("(?:(?<=[\\s\\.,\\\"'?!;:\\)\\(\\{\\}\\[\\]])|^)(?:", 0);
    phraseModifierSyntax.add(new EscapeTextilePhraseModifier());
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimpleTextilePhraseModifier("**", SpanType.BOLD, Mode.NESTING));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimpleTextilePhraseModifier("??", SpanType.CITATION, Mode.NESTING));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimpleTextilePhraseModifier("__", SpanType.ITALIC, Mode.NESTING));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimpleTextilePhraseModifier("_", SpanType.EMPHASIS, Mode.NESTING));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimpleTextilePhraseModifier("*", SpanType.STRONG, Mode.NESTING));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimpleTextilePhraseModifier("+", SpanType.INSERTED, Mode.NESTING));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimpleTextilePhraseModifier("~", SpanType.SUBSCRIPT, Mode.NORMAL));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimpleTextilePhraseModifier("^", SpanType.SUPERSCRIPT, Mode.NORMAL));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimpleTextilePhraseModifier("@", SpanType.CODE, Mode.SPECIAL));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimpleTextilePhraseModifier("%", SpanType.SPAN, Mode.NESTING));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimpleTextilePhraseModifier("-", SpanType.DELETED, Mode.NESTING));
    phraseModifierSyntax.add(new ImageTextilePhraseModifier());
    // hyperlinks are actually a phrase modifier see bug 283093
    phraseModifierSyntax.add(new HyperlinkPhraseModifier());
    // $NON-NLS-1$
    phraseModifierSyntax.endGroup(")(?=\\W|$)", 0);
}
Also used : TagEscapeTextilePhraseModifier(org.eclipse.mylyn.wikitext.textile.internal.phrase.TagEscapeTextilePhraseModifier) TagEscapeTextilePhraseModifier(org.eclipse.mylyn.wikitext.textile.internal.phrase.TagEscapeTextilePhraseModifier) EscapeTextilePhraseModifier(org.eclipse.mylyn.wikitext.textile.internal.phrase.EscapeTextilePhraseModifier) HyperlinkPhraseModifier(org.eclipse.mylyn.wikitext.textile.internal.phrase.HyperlinkPhraseModifier) HtmlEndTagPhraseModifier(org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlEndTagPhraseModifier) SimpleTextilePhraseModifier(org.eclipse.mylyn.wikitext.textile.internal.phrase.SimpleTextilePhraseModifier) HtmlStartTagPhraseModifier(org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlStartTagPhraseModifier) ImageTextilePhraseModifier(org.eclipse.mylyn.wikitext.textile.internal.phrase.ImageTextilePhraseModifier)

Example 2 with HtmlStartTagPhraseModifier

use of org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlStartTagPhraseModifier 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)

Example 3 with HtmlStartTagPhraseModifier

use of org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlStartTagPhraseModifier in project mylyn.docs by eclipse.

the class MarkdownLanguage method addStandardPhraseModifiers.

@Override
protected void addStandardPhraseModifiers(PatternBasedSyntax phraseModifierSyntax) {
    // inline HTML
    phraseModifierSyntax.add(new HtmlEndTagPhraseModifier());
    phraseModifierSyntax.add(new HtmlStartTagPhraseModifier());
    // images
    phraseModifierSyntax.add(new InlineImageReplacementToken());
    phraseModifierSyntax.add(new ReferenceStyleImageReplacementToken());
    // links
    phraseModifierSyntax.add(new InlineLinkReplacementToken());
    phraseModifierSyntax.add(new ReferenceStyleLinkReplacementToken());
    phraseModifierSyntax.add(new AutomaticLinkReplacementToken());
    // backslash escaped span elements
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("**"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("__"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("*"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("_"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("\\"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("`"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("{"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("}"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("["));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("]"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("("));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier(")"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("#"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("+"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("-"));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("."));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new BackslashEscapePhraseModifier("!"));
    // emphasis span elements
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("``", SpanType.CODE));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("`", SpanType.CODE));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("**", SpanType.STRONG));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("__", SpanType.STRONG));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("*", SpanType.EMPHASIS));
    // $NON-NLS-1$
    phraseModifierSyntax.add(new SimplePhraseModifier("_", SpanType.EMPHASIS));
}
Also used : BackslashEscapePhraseModifier(org.eclipse.mylyn.wikitext.markdown.internal.phrase.BackslashEscapePhraseModifier) SimplePhraseModifier(org.eclipse.mylyn.wikitext.markdown.internal.phrase.SimplePhraseModifier) HtmlEndTagPhraseModifier(org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlEndTagPhraseModifier) InlineImageReplacementToken(org.eclipse.mylyn.wikitext.markdown.internal.token.InlineImageReplacementToken) ReferenceStyleLinkReplacementToken(org.eclipse.mylyn.wikitext.markdown.internal.token.ReferenceStyleLinkReplacementToken) AutomaticLinkReplacementToken(org.eclipse.mylyn.wikitext.markdown.internal.token.AutomaticLinkReplacementToken) InlineLinkReplacementToken(org.eclipse.mylyn.wikitext.markdown.internal.token.InlineLinkReplacementToken) HtmlStartTagPhraseModifier(org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlStartTagPhraseModifier) ReferenceStyleImageReplacementToken(org.eclipse.mylyn.wikitext.markdown.internal.token.ReferenceStyleImageReplacementToken)

Aggregations

HtmlEndTagPhraseModifier (org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlEndTagPhraseModifier)3 HtmlStartTagPhraseModifier (org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlStartTagPhraseModifier)3 BackslashEscapePhraseModifier (org.eclipse.mylyn.wikitext.markdown.internal.phrase.BackslashEscapePhraseModifier)1 SimplePhraseModifier (org.eclipse.mylyn.wikitext.markdown.internal.phrase.SimplePhraseModifier)1 AutomaticLinkReplacementToken (org.eclipse.mylyn.wikitext.markdown.internal.token.AutomaticLinkReplacementToken)1 InlineImageReplacementToken (org.eclipse.mylyn.wikitext.markdown.internal.token.InlineImageReplacementToken)1 InlineLinkReplacementToken (org.eclipse.mylyn.wikitext.markdown.internal.token.InlineLinkReplacementToken)1 ReferenceStyleImageReplacementToken (org.eclipse.mylyn.wikitext.markdown.internal.token.ReferenceStyleImageReplacementToken)1 ReferenceStyleLinkReplacementToken (org.eclipse.mylyn.wikitext.markdown.internal.token.ReferenceStyleLinkReplacementToken)1 SpanType (org.eclipse.mylyn.wikitext.parser.DocumentBuilder.SpanType)1 EscapeTextilePhraseModifier (org.eclipse.mylyn.wikitext.textile.internal.phrase.EscapeTextilePhraseModifier)1 HyperlinkPhraseModifier (org.eclipse.mylyn.wikitext.textile.internal.phrase.HyperlinkPhraseModifier)1 ImageTextilePhraseModifier (org.eclipse.mylyn.wikitext.textile.internal.phrase.ImageTextilePhraseModifier)1 SimpleTextilePhraseModifier (org.eclipse.mylyn.wikitext.textile.internal.phrase.SimpleTextilePhraseModifier)1 TagEscapeTextilePhraseModifier (org.eclipse.mylyn.wikitext.textile.internal.phrase.TagEscapeTextilePhraseModifier)1 AutoLinkSwitchPhraseModifier (org.eclipse.mylyn.wikitext.twiki.internal.phrase.AutoLinkSwitchPhraseModifier)1 SimplePhraseModifier (org.eclipse.mylyn.wikitext.twiki.internal.phrase.SimplePhraseModifier)1