mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-18 14:17:30 +00:00
* style(prettier): Use prettier for code formatting This saves us style issues. Also adds husky and lint-staged for pre-commit testing Refs https://github.com/documentationjs/documentation/issues/709
19 lines
422 B
JavaScript
19 lines
422 B
JavaScript
/* @flow */
|
|
'use strict';
|
|
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;
|