Copied!

Interface for a delimiter processor

AbstractInterface
Methods
public abstract getClosingCharacter() : string
 

Returns the character that marks the ending of a delimited node.

This must not clash with any other processors being added to the environment.

Note that for a symmetric delimiter such as "*", this is the same as the opening.

public abstract getDelimiterUse(League\CommonMark\Delimiter\DelimiterInterface $opener, League\CommonMark\Delimiter\DelimiterInterface $closer) : int
 

Determine how many (if any) of the delimiter characters should be used.

This allows implementations to decide how many characters to be used based on the properties of the delimiter runs. An implementation can also return 0 when it doesn't want to allow this particular combination of delimiter runs.

IMPORTANT: Unless this method returns the same hard-coded value in all cases, you MUST implement the CacheableDelimiterProcessorInterface interface instead.

  • param \DelimiterInterface $opener The opening delimiter run
  • param \DelimiterInterface $closer The closing delimiter run
public abstract getMinLength() : int
 

Minimum number of delimiter characters that are needed to active this.

Must be at least 1.

public abstract getOpeningCharacter() : string
 

Returns the character that marks the beginning of a delimited node.

This must not clash with any other processors being added to the environment.

public abstract process(League\CommonMark\Node\Inline\AbstractStringContainer $opener, League\CommonMark\Node\Inline\AbstractStringContainer $closer, int $delimiterUse) : void
 

Process the matched delimiters, e.g. by wrapping the nodes between opener and closer in a new node, or appending a new node after the opener.

Note that removal of the delimiter from the delimiter nodes and detaching them is done by the caller.

  • param \AbstractStringContainer $opener The node that contained the opening delimiter
  • param \AbstractStringContainer $closer The node that contained the closing delimiter
  • param int $delimiterUse The number of delimiters that were used
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration