We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d88d4a7 + 9f3b2f8 commit f4e1121Copy full SHA for f4e1121
plugins/autodetect.js
@@ -19,7 +19,7 @@ codeInput.plugins.Autodetect = class extends codeInput.Plugin {
19
afterHighlight(codeInput) {
20
let langClass = codeInput.codeElement.className || codeInput.preElement.className;
21
let lang = langClass.match(/lang(\w|-)*/i)[0]; // Get word starting with lang...; Get outer bracket
22
- lang = lang.split("-")[1];
+ lang = lang.match(/(?<=-)(\w|-)*/i)[0];
23
if(lang == "undefined") {
24
codeInput.removeAttribute("language");
25
codeInput.removeAttribute("lang");
0 commit comments