Search in sources :

Example 1 with GfmUser

use of com.vladsch.flexmark.ext.gfm.users.GfmUser in project flexmark-java by vsch.

the class GfmUsersInlineParserExtension method parse.

@Override
public boolean parse(final InlineParser inlineParser) {
    BasedSequence[] matches = inlineParser.matchWithGroups(GITHUB_USER);
    if (matches != null) {
        BasedSequence input = inlineParser.getInput();
        inlineParser.flushTextNode();
        BasedSequence openMarker = matches[1];
        BasedSequence text = matches[2];
        GfmUser gitHubIssue = new GfmUser(openMarker, text);
        inlineParser.getBlock().appendChild(gitHubIssue);
        return true;
    }
    return false;
}
Also used : BasedSequence(com.vladsch.flexmark.util.sequence.BasedSequence) GfmUser(com.vladsch.flexmark.ext.gfm.users.GfmUser)

Aggregations

GfmUser (com.vladsch.flexmark.ext.gfm.users.GfmUser)1 BasedSequence (com.vladsch.flexmark.util.sequence.BasedSequence)1