Skip to content

Commit 031504b

Browse files
authored
feat(CodeBlock): removed automatic language identification for performance optimization (#468)
1 parent dee6615 commit 031504b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/extensions/markdown/CodeBlock/CodeBlockHighlight/CodeBlockHighlight.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ export const CodeBlockHighlight: ExtensionAuto<CodeBlockHighlightOptions> = (bui
169169
let nodes: Root['children'];
170170

171171
const lang: string | undefined = node.attrs[codeBlockLangAttr];
172-
if (!lang) {
173-
nodes = lowlight.highlightAuto(node.textContent).children;
174-
} else if (lowlight.registered(lang)) {
172+
if (lang && lowlight.registered(lang)) {
175173
nodes = lowlight.highlight(lang, node.textContent).children;
176174
} else {
177175
continue;

0 commit comments

Comments
 (0)