Search in sources :

Example 1 with InlineImageReplacementToken

use of org.eclipse.mylyn.wikitext.markdown.internal.token.InlineImageReplacementToken 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)

Example 2 with InlineImageReplacementToken

use of org.eclipse.mylyn.wikitext.markdown.internal.token.InlineImageReplacementToken in project mylyn.docs by eclipse.

the class MarkdownLanguage method addStandardTokens.

@Override
protected void addStandardTokens(PatternBasedSyntax tokenSyntax) {
    // HTML entities are preserved
    tokenSyntax.add(new PreserverHtmlEntityToken());
    // inline links have to be handled as tokens, as they can be embedded in phrases
    tokenSyntax.add(new InlineLinkReplacementToken());
    tokenSyntax.add(new InlineImageReplacementToken());
    // two or more spaces at end of line force a line break
    // $NON-NLS-1$
    tokenSyntax.add(new PatternLineBreakReplacementToken("( {2,})$"));
}
Also used : PreserverHtmlEntityToken(org.eclipse.mylyn.wikitext.markdown.internal.token.PreserverHtmlEntityToken) InlineImageReplacementToken(org.eclipse.mylyn.wikitext.markdown.internal.token.InlineImageReplacementToken) PatternLineBreakReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.PatternLineBreakReplacementToken) InlineLinkReplacementToken(org.eclipse.mylyn.wikitext.markdown.internal.token.InlineLinkReplacementToken)

Aggregations

InlineImageReplacementToken (org.eclipse.mylyn.wikitext.markdown.internal.token.InlineImageReplacementToken)2 InlineLinkReplacementToken (org.eclipse.mylyn.wikitext.markdown.internal.token.InlineLinkReplacementToken)2 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 PreserverHtmlEntityToken (org.eclipse.mylyn.wikitext.markdown.internal.token.PreserverHtmlEntityToken)1 ReferenceStyleImageReplacementToken (org.eclipse.mylyn.wikitext.markdown.internal.token.ReferenceStyleImageReplacementToken)1 ReferenceStyleLinkReplacementToken (org.eclipse.mylyn.wikitext.markdown.internal.token.ReferenceStyleLinkReplacementToken)1 HtmlEndTagPhraseModifier (org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlEndTagPhraseModifier)1 HtmlStartTagPhraseModifier (org.eclipse.mylyn.wikitext.parser.markup.phrase.HtmlStartTagPhraseModifier)1 PatternLineBreakReplacementToken (org.eclipse.mylyn.wikitext.parser.markup.token.PatternLineBreakReplacementToken)1