| 24 | import doctocatLinkIcon from './doctocat-link-icon.js' |
| 25 | |
| 26 | export default function createProcessor(context) { |
| 27 | return unified() |
| 28 | .use(process.env.COMMONMARK ? markdownNext : markdown) |
| 29 | .use(process.env.COMMONMARK ? gfm : null) |
| 30 | .use(remarkCodeExtra, { transform: codeHeader }) |
| 31 | .use(emoji) |
| 32 | .use(remark2rehype, { allowDangerousHtml: true }) |
| 33 | .use(slug) |
| 34 | .use(useEnglishHeadings, context) |
| 35 | .use(autolinkHeadings, { |
| 36 | behavior: 'prepend', |
| 37 | properties: { ariaHidden: true, tabIndex: -1, class: 'doctocat-link' }, |
| 38 | content: doctocatLinkIcon, |
| 39 | }) |
| 40 | .use(highlight, { |
| 41 | languages: { graphql, dockerfile, http, groovy, erb, powershell }, |
| 42 | subset: false, |
| 43 | }) |
| 44 | .use(raw) |
| 45 | .use(wrapInElement, { selector: 'ol > li img', wrapper: 'span.procedural-image-wrapper' }) |
| 46 | .use(rewriteImgSources) |
| 47 | .use(rewriteLocalLinks, context) |
| 48 | .use(html) |
| 49 | } |
| 50 | |
| 51 | export function createMinimalProcessor(context) { |
| 52 | return unified() |