Search in sources :

Example 1 with EntityReferenceReplacementToken

use of org.eclipse.mylyn.wikitext.parser.markup.token.EntityReferenceReplacementToken in project mylyn.docs by eclipse.

the class MediaWikiLanguage method addStandardTokens.

@Override
protected void addStandardTokens(PatternBasedSyntax tokenSyntax) {
    tokenSyntax.add(new LineBreakToken());
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(tm)", "#8482"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(TM)", "#8482"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(c)", "#169"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(C)", "#169"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(r)", "#174"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(R)", "#174"));
    tokenSyntax.add(new ImageReplacementToken());
    tokenSyntax.add(new HyperlinkInternalReplacementToken());
    tokenSyntax.add(new HyperlinkExternalReplacementToken());
    tokenSyntax.add(new ImpliedHyperlinkReplacementToken());
    // horizontal rule //$NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new PatternLiteralReplacementToken("(?:(?<=^|\\w\\s)(----)(?=$|\\s\\w))", "<hr/>"));
    tokenSyntax.add(new org.eclipse.mylyn.wikitext.mediawiki.internal.token.EntityReferenceReplacementToken());
}
Also used : PatternLiteralReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.PatternLiteralReplacementToken) EntityReferenceReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.EntityReferenceReplacementToken) HyperlinkExternalReplacementToken(org.eclipse.mylyn.wikitext.mediawiki.internal.token.HyperlinkExternalReplacementToken) LineBreakToken(org.eclipse.mylyn.wikitext.mediawiki.internal.token.LineBreakToken) HyperlinkInternalReplacementToken(org.eclipse.mylyn.wikitext.mediawiki.internal.token.HyperlinkInternalReplacementToken) ImpliedHyperlinkReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.ImpliedHyperlinkReplacementToken) ImageReplacementToken(org.eclipse.mylyn.wikitext.mediawiki.internal.token.ImageReplacementToken)

Example 2 with EntityReferenceReplacementToken

use of org.eclipse.mylyn.wikitext.parser.markup.token.EntityReferenceReplacementToken in project mylyn.docs by eclipse.

the class TextileLanguage method addStandardTokens.

@Override
protected void addStandardTokens(PatternBasedSyntax tokenSyntax) {
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(tm)", "#8482"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(TM)", "#8482"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(c)", "#169"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(C)", "#169"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(r)", "#174"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(R)", "#174"));
    tokenSyntax.add(new FootnoteReferenceReplacementToken());
    if (configuration == null || !configuration.isOptimizeForRepositoryUsage()) {
        ResourceBundle res = ResourceBundle.getBundle(BUNDLE_NAME, configuration == null || configuration.getLocale() == null ? Locale.ENGLISH : configuration.getLocale());
        tokenSyntax.add(new // $NON-NLS-1$//$NON-NLS-2$
        EntityWrappingReplacementToken(// $NON-NLS-1$//$NON-NLS-2$
        "\"", // $NON-NLS-1$//$NON-NLS-2$
        res.getString("quote_left"), // $NON-NLS-1$
        res.getString("quote_right")));
        tokenSyntax.add(new // $NON-NLS-1$//$NON-NLS-2$
        EntityWrappingReplacementToken(// $NON-NLS-1$//$NON-NLS-2$
        "'", // $NON-NLS-1$//$NON-NLS-2$
        res.getString("singlequote_left"), // $NON-NLS-1$
        res.getString("singlequote_right")));
        // apostrophe //$NON-NLS-1$ //$NON-NLS-2$
        tokenSyntax.add(new PatternEntityReferenceReplacementToken("(?:(?<=\\w)(')(?=\\w))", "#8217"));
    }
    // emdash //$NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new PatternEntityReferenceReplacementToken("(?:(--)(?=\\s\\w))", "#8212"));
    // endash //$NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new PatternEntityReferenceReplacementToken("(?:(?<=\\w\\s)(-)(?=\\s\\w))", "#8211"));
    // mul //$NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new PatternEntityReferenceReplacementToken("(?:(?<=\\d\\s)(x)(?=\\s\\d))", "#215"));
    if (configuration == null || !configuration.isOptimizeForRepositoryUsage()) {
        tokenSyntax.add(new AcronymReplacementToken());
    }
    tokenSyntax.add(new EntityReplacementToken());
}
Also used : EntityReferenceReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.EntityReferenceReplacementToken) PatternEntityReferenceReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.PatternEntityReferenceReplacementToken) ResourceBundle(java.util.ResourceBundle) PatternEntityReferenceReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.PatternEntityReferenceReplacementToken) EntityReplacementToken(org.eclipse.mylyn.wikitext.textile.internal.token.EntityReplacementToken) AcronymReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.AcronymReplacementToken) FootnoteReferenceReplacementToken(org.eclipse.mylyn.wikitext.textile.internal.token.FootnoteReferenceReplacementToken)

Example 3 with EntityReferenceReplacementToken

use of org.eclipse.mylyn.wikitext.parser.markup.token.EntityReferenceReplacementToken in project mylyn.docs by eclipse.

the class TWikiLanguage method addStandardTokens.

@Override
protected void addStandardTokens(PatternBasedSyntax tokenSyntax) {
    // IMPORTANT NOTE: Most items below have order dependencies.  DO NOT REORDER ITEMS BELOW!!
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(tm)", "#8482"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(TM)", "#8482"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(c)", "#169"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(C)", "#169"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(r)", "#174"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(R)", "#174"));
    tokenSyntax.add(new LinkReplacementToken());
    tokenSyntax.add(new ImpliedHyperlinkReplacementToken());
    tokenSyntax.add(new ImpliedEmailLinkReplacementToken());
    tokenSyntax.add(new WikiWordReplacementToken());
    tokenSyntax.add(new IconReplacementToken());
    literalTokenSyntax.add(new ImpliedHyperlinkReplacementToken());
}
Also used : WikiWordReplacementToken(org.eclipse.mylyn.wikitext.twiki.internal.token.WikiWordReplacementToken) EntityReferenceReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.EntityReferenceReplacementToken) ImpliedEmailLinkReplacementToken(org.eclipse.mylyn.wikitext.twiki.internal.token.ImpliedEmailLinkReplacementToken) IconReplacementToken(org.eclipse.mylyn.wikitext.twiki.internal.token.IconReplacementToken) ImpliedEmailLinkReplacementToken(org.eclipse.mylyn.wikitext.twiki.internal.token.ImpliedEmailLinkReplacementToken) LinkReplacementToken(org.eclipse.mylyn.wikitext.twiki.internal.token.LinkReplacementToken) ImpliedHyperlinkReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.ImpliedHyperlinkReplacementToken)

Example 4 with EntityReferenceReplacementToken

use of org.eclipse.mylyn.wikitext.parser.markup.token.EntityReferenceReplacementToken in project mylyn.docs by eclipse.

the class ConfluenceLanguage method addStandardTokens.

@Override
protected void addStandardTokens(PatternBasedSyntax tokenSyntax) {
    // line break //$NON-NLS-1$
    tokenSyntax.add(new PatternLineBreakReplacementToken("(\\\\\\\\ ?)"));
    // ORDER DEPENDENCY must come after line break
    tokenSyntax.add(new EscapedCharacterReplacementToken());
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(tm)", "#8482"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(TM)", "#8482"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(c)", "#169"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(C)", "#169"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(r)", "#174"));
    // $NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new EntityReferenceReplacementToken("(R)", "#174"));
    // emdash //$NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new PatternEntityReferenceReplacementToken("(?:(?<=(?:\\w\\s)|^)(---)(?=\\s\\w))", "#8212"));
    // endash //$NON-NLS-1$ //$NON-NLS-2$
    tokenSyntax.add(new PatternEntityReferenceReplacementToken("(?:(?<=(?:\\w\\s)|^)(--)(?=\\s\\w))", "#8211"));
    tokenSyntax.add(new HorizontalRuleToken());
    tokenSyntax.add(new ImpliedHyperlinkReplacementToken());
    tokenSyntax.add(new AnchorReplacementToken());
    tokenSyntax.add(new NumericEntityReferenceReplacementToken());
}
Also used : NumericEntityReferenceReplacementToken(org.eclipse.mylyn.wikitext.confluence.internal.token.NumericEntityReferenceReplacementToken) NumericEntityReferenceReplacementToken(org.eclipse.mylyn.wikitext.confluence.internal.token.NumericEntityReferenceReplacementToken) EntityReferenceReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.EntityReferenceReplacementToken) PatternEntityReferenceReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.PatternEntityReferenceReplacementToken) PatternEntityReferenceReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.PatternEntityReferenceReplacementToken) PatternLineBreakReplacementToken(org.eclipse.mylyn.wikitext.parser.markup.token.PatternLineBreakReplacementToken) HorizontalRuleToken(org.eclipse.mylyn.wikitext.confluence.internal.token.HorizontalRuleToken) ImpliedHyperlinkReplacementToken(org.eclipse.mylyn.wikitext.confluence.internal.token.ImpliedHyperlinkReplacementToken) EscapedCharacterReplacementToken(org.eclipse.mylyn.wikitext.confluence.internal.token.EscapedCharacterReplacementToken) AnchorReplacementToken(org.eclipse.mylyn.wikitext.confluence.internal.token.AnchorReplacementToken)

Aggregations

EntityReferenceReplacementToken (org.eclipse.mylyn.wikitext.parser.markup.token.EntityReferenceReplacementToken)4 ImpliedHyperlinkReplacementToken (org.eclipse.mylyn.wikitext.parser.markup.token.ImpliedHyperlinkReplacementToken)2 PatternEntityReferenceReplacementToken (org.eclipse.mylyn.wikitext.parser.markup.token.PatternEntityReferenceReplacementToken)2 ResourceBundle (java.util.ResourceBundle)1 AnchorReplacementToken (org.eclipse.mylyn.wikitext.confluence.internal.token.AnchorReplacementToken)1 EscapedCharacterReplacementToken (org.eclipse.mylyn.wikitext.confluence.internal.token.EscapedCharacterReplacementToken)1 HorizontalRuleToken (org.eclipse.mylyn.wikitext.confluence.internal.token.HorizontalRuleToken)1 ImpliedHyperlinkReplacementToken (org.eclipse.mylyn.wikitext.confluence.internal.token.ImpliedHyperlinkReplacementToken)1 NumericEntityReferenceReplacementToken (org.eclipse.mylyn.wikitext.confluence.internal.token.NumericEntityReferenceReplacementToken)1 HyperlinkExternalReplacementToken (org.eclipse.mylyn.wikitext.mediawiki.internal.token.HyperlinkExternalReplacementToken)1 HyperlinkInternalReplacementToken (org.eclipse.mylyn.wikitext.mediawiki.internal.token.HyperlinkInternalReplacementToken)1 ImageReplacementToken (org.eclipse.mylyn.wikitext.mediawiki.internal.token.ImageReplacementToken)1 LineBreakToken (org.eclipse.mylyn.wikitext.mediawiki.internal.token.LineBreakToken)1 AcronymReplacementToken (org.eclipse.mylyn.wikitext.parser.markup.token.AcronymReplacementToken)1 PatternLineBreakReplacementToken (org.eclipse.mylyn.wikitext.parser.markup.token.PatternLineBreakReplacementToken)1 PatternLiteralReplacementToken (org.eclipse.mylyn.wikitext.parser.markup.token.PatternLiteralReplacementToken)1 EntityReplacementToken (org.eclipse.mylyn.wikitext.textile.internal.token.EntityReplacementToken)1 FootnoteReferenceReplacementToken (org.eclipse.mylyn.wikitext.textile.internal.token.FootnoteReferenceReplacementToken)1 IconReplacementToken (org.eclipse.mylyn.wikitext.twiki.internal.token.IconReplacementToken)1 ImpliedEmailLinkReplacementToken (org.eclipse.mylyn.wikitext.twiki.internal.token.ImpliedEmailLinkReplacementToken)1