Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return async tree => {
const highlighter = await shiki.getHighlighter({
theme,
langs: languages
})
visit(tree, 'code', node => {
node.type = 'html'
try {
node.value = highlight(node, CLASS_BLOCK, highlighter)
} catch (e) {
node.value = ERROR_MESSAGE
}
})
if (!options.skipInline) {
visit(tree, 'inlineCode', node => {
node.type = 'html'