docs_vue2/one/build/rehype-pre.js

12 lines
240 B
JavaScript
Raw Permalink Normal View History

2021-09-25 15:17:57 +08:00
import visit from 'unist-util-visit'
export default function attacher () {
return tree => {
visit(tree, 'element', ({ tagName, properties }) => {
if (tagName === 'pre') {
properties['v-pre'] = true
}
})
}
}