Merge pull request #5029 from uhoreg/sanitize_language
don't syntax highlight languages that begin with "_"
This commit is contained in:
commit
cbe4f04cd7
3 changed files with 3 additions and 3 deletions
|
@ -64,7 +64,7 @@ function parseCodeBlock(n: HTMLElement, partCreator: PartCreator) {
|
|||
let language = "";
|
||||
if (n.firstChild && n.firstChild.nodeName === "CODE") {
|
||||
for (const className of (<HTMLElement>n.firstChild).classList) {
|
||||
if (className.startsWith("language-")) {
|
||||
if (className.startsWith("language-") && !className.startsWith("language-_")) {
|
||||
language = className.substr("language-".length);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue