use of org.eclipse.mylyn.wikitext.parser.markup.token.AcronymReplacementToken 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());
}
Aggregations