Skip to content

streamich/md-mdast

Repository files navigation

md-mdast

  • Markdown to MDAST converter.
  • Small and fast.
  • No dependencies.

Installation

npm install md-mdast

Usage

const {create} = require('md-mdast');

const parser = create();

console.log(parser.tokenizeBlock('*hello* __world__'));

Result:

{ type: 'root',
  children:
   [ { type: 'paragraph',
       children:
        [ { type: 'emphasis',
            children: [ { type: 'text', value: 'hello' } ] },
          { type: 'text', value: ' ' },
          { type: 'strong',
            children: [ { type: 'text', value: 'world' } ] } ] } ],
}

License

Unlicense — public domain.