Out of the box, remark parses and serializes CommonMark — the standardized, unambiguous specification of markdown. CommonMark covers the essential constructs: paragraphs, headings, lists, links, images, code, and emphasis. Anything beyond that — strikethrough, tables, footnotes, YAML front matter, LaTeX math, JSX — requires a plugin. This design keeps the core lean and predictable while letting you opt in to exactly the syntax your project needs.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/remarkjs/remark/llms.txt
Use this file to discover all available pages before exploring further.
GitHub Flavored Markdown (GFM)
GitHub Flavored Markdown is the most widely used markdown dialect. It extends CommonMark with:- Autolink literals — bare URLs are turned into links automatically.
- Footnotes —
[^1]style footnote references and definitions. - Strikethrough —
~~text~~renders as<del>text</del>. - Tables — pipe-delimited table syntax.
- Tasklists —
- [ ]and- [x]checkboxes in lists.
remark-gfm:
remark-gfm registers both the micromark tokenizer extension and the mdast-util extension, so it works for both parsing and serializing GFM syntax.
YAML frontmatter
Many static site generators and content pipelines expect a YAML block at the top of a markdown file to carry metadata like title, date, or layout. Theremark-frontmatter plugin adds support for parsing this block into the syntax tree as a dedicated yaml node.
Install the plugin:
remark-rehype, it is excluded from the output by default — it does not appear as rendered content.
Other notable extensions
A rich ecosystem of syntax extension plugins exists beyond GFM and frontmatter. Here is a summary of the most commonly used ones:| Plugin | What it adds |
|---|---|
remark-math | LaTeX math syntax — inline $...$ and block $$...$$ |
remark-mdx | MDX support — JSX expressions and components inside markdown |
remark-directive | Generic directives proposal — :name[content]{attrs} |
remark-footnotes | Footnotes (also included in remark-gfm) |
remark-breaks | Treat single newlines as hard line breaks |
.use().
How syntax extensions work under the hood
There is an important distinction between syntax extension plugins and transformer plugins. A transformer plugin (like
remark-toc or remark-lint) receives the already-parsed mdast tree and modifies it. A syntax extension plugin (like remark-gfm or remark-math) teaches the parser itself to recognize new syntax, producing new node types in the tree before any transformer runs.If you add a syntax extension plugin after remark-stringify in the pipeline, the serializer will not know how to handle the new node types. Always place syntax plugins before any output plugin.data store at configuration time. There are three hooks:
data('micromarkExtensions')— provides tokenizer-level extensions to micromark, the underlying markdown parser. This is what allows new syntax to be recognized at all.data('fromMarkdownExtensions')— provides extensions tomdast-util-from-markdown, which converts micromark tokens into mdast nodes.data('toMarkdownExtensions')— provides extensions tomdast-util-to-markdown, which serializes mdast nodes back to markdown text.
remark-gfm to your pipeline, it populates all three of these data slots automatically — you do not need to interact with them directly unless you are building your own syntax extension from scratch.
Combining multiple extensions
Extensions compose cleanly. You can chain as many.use() calls as you need:
remark-rehype, and all rehype plugins must come after it.
Next steps
Creating Plugins
Build your own remark plugin that transforms the mdast tree.
Markdown to HTML
Full walkthrough of converting markdown to sanitized HTML.