nuckty
RU
All sections →

Markdown extensions

The catalog of markdown-type extensions. They add markdown constructs to CommonMark: callouts, galleries, grids, video. Each is wired up through env.markdown.

How it works

Directive-based constructs use generic directives (:::name, ::name, :name). An extension maps a directive straight to a block node via env.markdown.directive(...); for other syntax and arbitrary transforms there is the low-level env.markdown.use(...). The full contract is in the markdown extension guide.

See the guide for an explicit MDAST conversion example. node.children is MDAST, not BEMTree: do not assign it directly to content.

A markdown construct almost always comes paired with a block extension that ships the block it expands into. That is why one package often combines a markdown extension and a block extension.

Registry

Markdown extensions:

Markdown constructs that come paired with a block live in block extensions: