MCPcopy
hub / github.com/remarkjs/react-markdown / createProcessor

Function createProcessor

lib/index.js:262–276  ·  view source on GitHub ↗

* Set up the `unified` processor. * * @param {Readonly } options * Props. * @returns {Processor } * Result.

(options)

Source from the content-addressed store, hash-verified

260 * Result.
261 */
262function createProcessor(options) {
263 const rehypePlugins = options.rehypePlugins || emptyPlugins
264 const remarkPlugins = options.remarkPlugins || emptyPlugins
265 const remarkRehypeOptions = options.remarkRehypeOptions
266 ? {...options.remarkRehypeOptions, ...emptyRemarkRehypeOptions}
267 : emptyRemarkRehypeOptions
268
269 const processor = unified()
270 .use(remarkParse)
271 .use(remarkPlugins)
272 .use(remarkRehype, remarkRehypeOptions)
273 .use(rehypePlugins)
274
275 return processor
276}
277
278/**
279 * Set up the virtual file.

Callers 3

MarkdownFunction · 0.85
MarkdownAsyncFunction · 0.85
MarkdownHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…