summaryrefslogtreecommitdiff
path: root/packages/markdown/remark/src/highlight.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/markdown/remark/src/highlight.ts')
-rw-r--r--packages/markdown/remark/src/highlight.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/markdown/remark/src/highlight.ts b/packages/markdown/remark/src/highlight.ts
index 41ec8880b..ef1a734ba 100644
--- a/packages/markdown/remark/src/highlight.ts
+++ b/packages/markdown/remark/src/highlight.ts
@@ -43,14 +43,14 @@ export async function highlightCodeBlocks(tree: Root, highlighter: Highlighter)
let languageMatch: RegExpMatchArray | null | undefined;
let { className } = node.properties;
if (typeof className === 'string') {
- languageMatch = className.match(languagePattern);
+ languageMatch = languagePattern.exec(className);
} else if (Array.isArray(className)) {
for (const cls of className) {
if (typeof cls !== 'string') {
continue;
}
- languageMatch = cls.match(languagePattern);
+ languageMatch = languagePattern.exec(cls);
if (languageMatch) {
break;
}