MarkdownSyntaxExtension Class

public abstract class MarkdownSyntaxExtension

Remarks

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

NameDescription
NameGets 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

string

Methods

NameDescription
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.

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.

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.