diff --git a/src/extensions/markdown/CodeBlock/CodeBlockHighlight/CodeBlockHighlight.ts b/src/extensions/markdown/CodeBlock/CodeBlockHighlight/CodeBlockHighlight.ts index 6b4f034a..8f8b9ceb 100644 --- a/src/extensions/markdown/CodeBlock/CodeBlockHighlight/CodeBlockHighlight.ts +++ b/src/extensions/markdown/CodeBlock/CodeBlockHighlight/CodeBlockHighlight.ts @@ -169,9 +169,7 @@ export const CodeBlockHighlight: ExtensionAuto = (bui let nodes: Root['children']; const lang: string | undefined = node.attrs[codeBlockLangAttr]; - if (!lang) { - nodes = lowlight.highlightAuto(node.textContent).children; - } else if (lowlight.registered(lang)) { + if (lang && lowlight.registered(lang)) { nodes = lowlight.highlight(lang, node.textContent).children; } else { continue;