don't syntax highlight languages that begin with "_"

This commit is contained in:
Hubert Chathi
2020-07-21 12:47:40 -04:00
parent f8f9c4880a
commit 2ce493307e
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -184,7 +184,7 @@ const transformTags: sanitizeHtml.IOptions["transformTags"] = { // custom to mat
if (typeof attribs.class !== 'undefined') {
// Filter out all classes other than ones starting with language- for syntax highlighting.
const classes = attribs.class.split(/\s/).filter(function(cl) {
return cl.startsWith('language-');
return cl.startsWith('language-') && !cl.startsWith('language-_');
});
attribs.class = classes.join(' ');
}