How to use the remark-parse/lib/block-elements.json function in remark-parse

To help you get started, we’ve selected a few remark-parse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mdx-js / mdx / parser / index.js View on Github external
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)
}

remark-parse

remark plugin to add support for parsing markdown input

MIT
Latest version published 1 year ago

Package Health Score

79 / 100
Full package analysis