You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the highlighting module included, any time there is a fenced block which is not qualified with a language, I would expect highlighting to fall back to being disabled for that block. However, I've started seeing an error like Could not find the language '', did you forget to load/include a language module? which suggest that the matching expression for enabling highlighting on a provided fenced syntax name is matching as an empty string, which triggers the logic for "I have been given a syntax, let me load that language, but I can't find it."
This seems like a new or recent bug. It could be confusion about what class names to match, but the error message doesn't share any of these details to help with diagnosis.
[edit] I suspect the error is in the matching below, but a guard condition on a non-empty string would probably fix it.
function blockLanguage(block) {
var match;
var classes = block.className + ' ';
classes += block.parentNode ? block.parentNode.className : '';
// language-* takes precedence over non-prefixed class names.
match = options.languageDetectRe.exec(classes);
if (match) {
var language = getLanguage(match[1]);
if (!language) {
console.warn(LANGUAGE_NOT_FOUND.replace("{}", match[1]));
console.warn("Falling back to no-highlight mode for this block.", block);
}
return language ? match[1] : 'no-highlight';
}
The text was updated successfully, but these errors were encountered:
With the highlighting module included, any time there is a fenced block which is not qualified with a language, I would expect highlighting to fall back to being disabled for that block. However, I've started seeing an error like
Could not find the language '', did you forget to load/include a language module?
which suggest that the matching expression for enabling highlighting on a provided fenced syntax name is matching as an empty string, which triggers the logic for "I have been given a syntax, let me load that language, but I can't find it."This seems like a new or recent bug. It could be confusion about what class names to match, but the error message doesn't share any of these details to help with diagnosis.
[edit] I suspect the error is in the matching below, but a guard condition on a non-empty string would probably fix it.
The text was updated successfully, but these errors were encountered: