* Set up the `unified` processor. * * @param {Readonly } options * Props. * @returns {Processor } * Result.
(options)
| 260 | * Result. |
| 261 | */ |
| 262 | function 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…