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
Workaround for other poor souls: make sure this gets run before PR.prettyPrint():
// Lift the `language-*` classnames from `code` elements up onto their `pre` parent elementsvarcodeElems=document.body.getElementsByTagName("code");for(vari=0;i<codeElems.length;++i){varcodeElem=codeElems[i];varlanguageClassesToLift=[];codeElem.classList.forEach(function(className){if(className.startsWith("language-"))languageClassesToLift.push(className);});if(codeElem.parentElement.classList.contains("prettyprint")){DOMTokenList.prototype.add.apply(codeElem.parentElement.classList,languageClassesToLift);}}
The text was updated successfully, but these errors were encountered:
There is even #450 suggesting to switch the library for syntax highlighting.
Right, I was the one who opened that too 😄. I think I'll focus my efforts on switching to highlight.js instead of fixing this - the main reason for opening the bug is to make sure others running into this issue realize what is causing it (and know how to work around it).
Putting an explicit language tag on a fenced code block does not work:
It generates the following (which I've indented):
However,
prettify
apparently expects the following instead (noticed thelanguage-mylang
class has moved):Workaround for other poor souls: make sure this gets run before
PR.prettyPrint()
:The text was updated successfully, but these errors were encountered: