Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const parse = (mdx, options = {}) => {
options.components = options.components || {}
// TODO: Need to figure out a better way to handle imports
// parsing. As implemented it parses the whole thing :(
options.blocks = Object
.keys(options.components)
.concat(getImports(mdx).scope)
.concat(blocks)
const fn = unified()
.use(remark, options)
.use(matter, { type: 'yaml', marker: '-' })
.use(parseImports, options)
.use(jsx, options)
.use(rehype)
.use(html)
return fn.processSync(mdx)
}