com.vladsch.flexmark.internal.Delimiter Java Examples

The following examples show how to use com.vladsch.flexmark.internal.Delimiter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EmojiDelimiterProcessor.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void process(Delimiter opener, Delimiter closer, int delimitersUsed) {
    // Normal case, wrap nodes between delimiters in emoji node.
    // don't allow any spaces between delimiters
    if (opener.getInput().subSequence(opener.getEndIndex(), closer.getStartIndex()).indexOfAny(BasedSequence.WHITESPACE_CHARS) == -1) {
        EmojiNode emoji = new EmojiNode(opener.getTailChars(delimitersUsed), BasedSequence.NULL, closer.getLeadChars(delimitersUsed));
        opener.moveNodesBetweenDelimitersTo(emoji, closer);
    } else {
        opener.convertDelimitersToText(delimitersUsed, closer);
    }
}
 
Example #2
Source File: EmojiDelimiterProcessor.java    From MarkdownView with Apache License 2.0 5 votes vote down vote up
@Override
public void process(Delimiter opener, Delimiter closer, int delimitersUsed) {
    // Normal case, wrap nodes between delimiters in emoji node.
    // don't allow any spaces between delimiters
    if (opener.getInput().subSequence(opener.getEndIndex(), closer.getStartIndex()).indexOfAny(BasedSequence.WHITESPACE_CHARS) == -1) {
        Emoji emoji = new Emoji(opener.getTailChars(delimitersUsed), BasedSequence.NULL, closer.getLeadChars(delimitersUsed));
        opener.moveNodesBetweenDelimitersTo(emoji, closer);
    } else {
        opener.convertDelimitersToText(delimitersUsed, closer);
    }
}
 
Example #3
Source File: MarkDelimiterProcessor.java    From OmniList with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void process(Delimiter opener, Delimiter closer, int delimitersUsed) {
    // wrap nodes between delimiters in strikethrough.
    Mark mark = new Mark(opener.getTailChars(delimitersUsed), BasedSequence.NULL, closer.getLeadChars(delimitersUsed));
    opener.moveNodesBetweenDelimitersTo(mark, closer);
}
 
Example #4
Source File: MathJaxDelimiterProcessor.java    From OmniList with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void process(Delimiter opener, Delimiter closer, int delimitersUsed) {
    // wrap nodes between delimiters in strikethrough.
    MathJax mj = new MathJax(opener.getTailChars(delimitersUsed), BasedSequence.NULL, closer.getLeadChars(delimitersUsed), delimitersUsed == 1);
    opener.moveNodesBetweenDelimitersTo(mj, closer);
}
 
Example #5
Source File: KeystrokeDelimiterProcessor.java    From MarkdownView with Apache License 2.0 4 votes vote down vote up
@Override
public void process(Delimiter opener, Delimiter closer, int delimitersUsed) {
    // wrap nodes between delimiters in strikethrough.
    Keystroke kbd = new Keystroke(opener.getTailChars(delimitersUsed), BasedSequence.NULL, closer.getLeadChars(delimitersUsed));
    opener.moveNodesBetweenDelimitersTo(kbd, closer);
}
 
Example #6
Source File: MarkDelimiterProcessor.java    From MarkdownView with Apache License 2.0 4 votes vote down vote up
@Override
public void process(Delimiter opener, Delimiter closer, int delimitersUsed) {
    // wrap nodes between delimiters in strikethrough.
    Mark mark = new Mark(opener.getTailChars(delimitersUsed), BasedSequence.NULL, closer.getLeadChars(delimitersUsed));
    opener.moveNodesBetweenDelimitersTo(mark, closer);
}
 
Example #7
Source File: MathJaxDelimiterProcessor.java    From MarkdownView with Apache License 2.0 4 votes vote down vote up
@Override
public void process(Delimiter opener, Delimiter closer, int delimitersUsed) {
    // wrap nodes between delimiters in strikethrough.
    MathJax mj = new MathJax(opener.getTailChars(delimitersUsed), BasedSequence.NULL, closer.getLeadChars(delimitersUsed), delimitersUsed == 1);
    opener.moveNodesBetweenDelimitersTo(mj, closer);
}
 
Example #8
Source File: LabelDelimiterProcessor.java    From MarkdownView with Apache License 2.0 4 votes vote down vote up
@Override
public void process(Delimiter opener, Delimiter closer, int delimitersUsed) {
    Label lbl = new Label(delimitersUsed, opener.getTailChars(delimitersUsed), BasedSequence.NULL, closer.getLeadChars(delimitersUsed));
    opener.moveNodesBetweenDelimitersTo(lbl, closer);
}
 
Example #9
Source File: BeanDelimiterProcessor.java    From MarkdownView with Apache License 2.0 4 votes vote down vote up
@Override
public void process(Delimiter opener, Delimiter closer, int delimitersUsed) {
    Bean loc = new Bean(opener.getTailChars(delimitersUsed), BasedSequence.NULL, closer.getLeadChars(delimitersUsed));
    opener.moveNodesBetweenDelimitersTo(loc, closer);
}