Package org.commonmark.ext.ins.internal
Class InsDelimiterProcessor
java.lang.Object
org.commonmark.ext.ins.internal.InsDelimiterProcessor
- All Implemented Interfaces:
DelimiterProcessor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncharintMinimum number of delimiter characters that are needed to activate this.charintprocess(DelimiterRun openingRun, DelimiterRun closingRun) Process the delimiter runs.
-
Constructor Details
-
InsDelimiterProcessor
public InsDelimiterProcessor()
-
-
Method Details
-
getOpeningCharacter
public char getOpeningCharacter()- Specified by:
getOpeningCharacterin interfaceDelimiterProcessor- Returns:
- the character that marks the beginning of a delimited node, must not clash with any built-in special characters
-
getClosingCharacter
public char getClosingCharacter()- Specified by:
getClosingCharacterin interfaceDelimiterProcessor- Returns:
- the character that marks the the ending of a delimited node, must not clash with any built-in special characters. Note that for a symmetric delimiter such as "*", this is the same as the opening.
-
getMinLength
public int getMinLength()Description copied from interface:DelimiterProcessorMinimum number of delimiter characters that are needed to activate this. Must be at least 1.- Specified by:
getMinLengthin interfaceDelimiterProcessor
-
process
Description copied from interface:DelimiterProcessorProcess the delimiter runs.The processor can examine the runs and the nodes and decide if it wants to process or not. If not, it should not change any nodes and return 0. If yes, it should do the processing (wrapping nodes, etc) and then return how many delimiters were used.
Note that removal (unlinking) of the used delimiter
Textnodes is done by the caller.- Specified by:
processin interfaceDelimiterProcessor- Parameters:
openingRun- the opening delimiter runclosingRun- the closing delimiter run- Returns:
- how many delimiters were used; must not be greater than length of either opener or closer
-