fix(read-only-note): syntax highlight not working (closes #668)

This commit is contained in:
Elian Doran 2024-11-30 14:16:45 +02:00
parent cb9678c991
commit b351293ea8
No known key found for this signature in database

View File

@ -32,7 +32,7 @@ export async function applySyntaxHighlight($container) {
continue; continue;
} }
applySingleBlockSyntaxHighlight($(codeBlock, normalizedMimeType)); applySingleBlockSyntaxHighlight($(codeBlock), normalizedMimeType);
} }
} }
@ -86,7 +86,7 @@ function extractLanguageFromClassList(el) {
const prefix = "language-"; const prefix = "language-";
for (const className of el.classList) { for (const className of el.classList) {
if (className.startsWith(prefix)) { if (className.startsWith(prefix)) {
return className.substr(prefix.length); return className.substring(prefix.length);
} }
} }