use of org.eclipse.mylyn.wikitext.textile.internal.phrase.TagEscapeTextilePhraseModifier 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);
}
use of org.eclipse.mylyn.wikitext.textile.internal.phrase.TagEscapeTextilePhraseModifier in project mylyn.docs by eclipse.
the class TagEscapeTextilePhraseModifierTest method assertMatch.
private void assertMatch(int offset, String content, String markup) {
String regex = new TagEscapeTextilePhraseModifier().getPattern(0);
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(markup);
assertTrue(matcher.find());
assertEquals(offset, matcher.start());
assertEquals(content, matcher.group(1));
}
Aggregations