Skip to content

Type Editor


Type Editor / @type-editor/markdown / types/ParseSpec / ParseSpec

Interface: ParseSpec

Defined in: types/ParseSpec.ts:8

Object type used to specify how Markdown tokens should be parsed.

Properties

PropertyTypeDescriptionDefined in
attrs?Readonly<Record<string, any>>Attributes for the node or mark. When getAttrs is provided, it takes precedence.types/ParseSpec.ts:39
block?stringThis token (unless noCloseToken is true) comes in _open and _close variants (which are appended to the base token name provides a the object property), and wraps a block of content. The block should be wrapped in a node of the type named to by the property's value. If the token does not have _open or _close, use the noCloseToken option.types/ParseSpec.ts:25
getAttrs?(token, tokenStream, index) => Readonly<Record<string, any>>A function used to compute the attributes for the node or mark that takes a markdown-it token and returns an attribute object.types/ParseSpec.ts:51
ignore?booleanWhen true, ignore content for the matched token.types/ParseSpec.ts:64
mark?stringThis token (again, unless noCloseToken is true) also comes in _open and _close variants, but should add a mark (named by the value) to its content, rather than wrapping it in a node.types/ParseSpec.ts:33
noCloseToken?booleanIndicates that the markdown-it token has no _open or _close for the nodes. This defaults to true for code_inline, code_block and fence.types/ParseSpec.ts:59
node?stringThis token maps to a single node, whose type can be looked up in the schema under the given name. Exactly one of node, block, or mark must be set.types/ParseSpec.ts:15