UNPKG

396 BJavaScriptView Raw
1const remark = require('remark');
2const inlineTokenizer = require('./inline_tokenizer');
3
4/**
5 * Parse a string of Markdown into a Remark
6 * abstract syntax tree.
7 *
8 * @param {string} string markdown text
9 * @returns {Object} abstract syntax tree
10 * @private
11 */
12function parseMarkdown(string) {
13 return remark()
14 .use(inlineTokenizer)
15 .parse(string);
16}
17
18module.exports = parseMarkdown;