MarkdownSyntaxExtension Class
A syntax that the parser reads in addition to CommonMark and to MarkdownExtensions: a MarkdownInlineExtension, a MarkdownDelimiterExtension, a MarkdownFencedBlockExtension or a MarkdownParagraphExtension. Add it to MarkdownParseOptions.SyntaxExtensions.
public abstract class MarkdownSyntaxExtensionRemarks
The constructs of an extension are MarkdownExtensionInlineSyntax or MarkdownExtensionBlockSyntax nodes, whose name is the MarkdownSyntaxExtension.Name of the extension. One instance parses every document, possibly on several threads at once: keep no state between calls, and use MarkdownSyntaxExtension.CreateState for the state of a document.
Properties
| Name | Description |
|---|---|
| Name | Gets the name of the extension, which the nodes of its constructs have: unique in MarkdownParseOptions.SyntaxExtensions. |
Gets the name of the extension, which the nodes of its constructs have: unique in MarkdownParseOptions.SyntaxExtensions.
public string Name { get; }Property value
Methods
| Name | Description |
|---|---|
| CreateState() | Creates the state of the extension for one document, such as the definitions that its blocks record and that its inlines read. The parser calls it the first time a context of the extension asks for its state, at most once per document. |
CreateState()
MarkdownSyntaxExtension.csCreates the state of the extension for one document, such as the definitions that its blocks record and that its inlines read. The parser calls it the first time a context of the extension asks for its state, at most once per document.
public virtual object? CreateState()Returns
object? The state, or null for none.
Remarks
The block extensions run before the inline extensions: every fenced block and paragraph of the document is read before the first inline. The cells of a grid table are documents of their own, with their own state.