mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-25 14:26:29 +00:00
* build: Use Flow syntax without comments. We're switching to Flow annotations - not Flow comments. This gives documentation.js the ability to self-document without JSDoc types and improves our compatibility with tools like prettier. Fixes #729. Fixes #709
18 lines
402 B
JavaScript
18 lines
402 B
JavaScript
/* @flow */
|
|
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: string) {
|
|
return remark().use(inlineTokenizer).parse(string);
|
|
}
|
|
|
|
module.exports = parseMarkdown;
|