micromark extension to support MDX (agnostic to JavaScript)

Downloads in past


401.0.0a year ago2 years agoMinified + gzip package size for micromark-extension-mdx in KB


!Buildbuild-badgebuild !Coveragecoverage-badgecoverage !Downloadsdownloads-badgedownloads !Sizesize-badgesize !Sponsorssponsors-badgecollective !Backersbackers-badgecollective !Chatchat-badgechat
micromark extension to support MDX (agnostic to JS). Use micromark-extension-mdxjsmdxjs instead to support MDX.js.
This package provides the low-level modules for integrating with the micromark tokenizer but has no handling of compiling to HTML: go to a syntax tree instead.

When to use this

You should probably use micromark-extension-mdxjsmdxjs instead, which supports JavaScript. Alternatively, if you don’t want JavaScript-aware parsing, use this package.
If you don’t need all of MDX, the extensions can be used separately:
— support MDX (or MDX.js) expressions
— support MDX (or MDX.js) JSX
— turn some markdown features off for MDX (or MDX.js)


This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.
npm install micromark-extension-mdx
## Use

import {micromark} from 'micromark'
import {mdx} from 'micromark-extension-mdx'

const output = micromark('a <b /> c {1 + 1} d', {extensions: [mdx()]})


<p>a  c  d</p>

…which is rather useless: go to a syntax tree with mdast-util-from-markdownfrom-markdown and mdast-util-mdxmdast-util-mdx instead.


This package exports the following identifiers: mdx. There is no default export.


A function that can be called which returns an extension for micromark to parse MDX (can be passed in extensions). There are no options yet.


— the smallest commonmark-compliant markdown parser that exists
— micromark extension to support MDX.js
— micromark extension to support MDX (or MDX.js) expressions
— micromark extension to support MDX (or MDX.js) JSX
— micromark extension to support misc MDX changes
— mdast utility to support MDX (or MDX.js)


See contributing.md in micromark/.githubcontributing for ways to get started. See support.mdsupport for ways to get help.
This project has a code of conductcoc. By interacting with this repository, organization, or community you agree to abide by its terms.


MITlicense © Titus Wormerauthor