mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-18 14:17:30 +00:00
19 lines
396 B
JavaScript
19 lines
396 B
JavaScript
const remark = require('remark');
|
|
const inlineTokenizer = require('./inline_tokenizer');
|
|
|
|
/**
|
|
* Parse a string of Markdown into a Remark
|
|
* abstract syntax tree.
|
|
*
|
|
* @param {string} string markdown text
|
|
* @returns {Object} abstract syntax tree
|
|
* @private
|
|
*/
|
|
function parseMarkdown(string) {
|
|
return remark()
|
|
.use(inlineTokenizer)
|
|
.parse(string);
|
|
}
|
|
|
|
module.exports = parseMarkdown;
|