You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
590 B
24 lines
590 B
'use strict' |
|
|
|
module.exports = parse |
|
|
|
var fromMarkdown = require('mdast-util-from-markdown') |
|
|
|
function parse(options) { |
|
var self = this |
|
|
|
this.Parser = parse |
|
|
|
function parse(doc) { |
|
return fromMarkdown( |
|
doc, |
|
Object.assign({}, self.data('settings'), options, { |
|
// Note: these options are not in the readme. |
|
// The goal is for them to be set by plugins on `data` instead of being |
|
// passed by users. |
|
extensions: self.data('micromarkExtensions') || [], |
|
mdastExtensions: self.data('fromMarkdownExtensions') || [] |
|
}) |
|
) |
|
} |
|
}
|
|
|