T
MarkdownRule
A simple-markdown rule: match finds it at the start of the source, parse builds its node, react renders it.
type MarkdownRule<TNode extends MarkdownNode = MarkdownNode> = { … }Members
order?
numberDiscord 349 ships highlight, guild and channel without one; the parser never calls those.
match
(source: string, state: MarkdownState, previous: string): RegExpExecArray | nullMatches the rule at the start of source; previous is the text already consumed. null means no match.
parse
(capture: RegExpExecArray, parse: MarkdownNestedParse, state: MarkdownState): TNodeBuilds the node from match's capture; call parse to parse nested Markdown.
react?
(node: TNode, output: MarkdownOutput, state: MarkdownState): ReactNodeRenders the node; call output to render its children.