mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-18 14:17:30 +00:00
17 lines
382 B
JavaScript
17 lines
382 B
JavaScript
var remark = require('remark');
|
|
var 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;
|