1 |
- function formatCode(e){if("P"!==e.parentNode.nodeName){var n=e.innerHTML.match(/\s*\n[\t\s]*/);e.innerHTML=e.innerHTML.replace(new RegExp(n,"g"),"\n"),"undefined"!=typeof hljs&&(e.innerHTML=hljs.highlightAuto(e.innerHTML).value)}}window.onload=function(){document.querySelectorAll("code").forEach(function(e,n){formatCode(e)}),document.querySelectorAll("xmp").forEach(function(e,n){var o=e.innerHTML.match(/\s*\n[\t\s]*/),r=e.innerHTML.replace(new RegExp(o,"g"),"\n"),t=document.createElement("code");"undefined"!=typeof hljs?(t.innerHTML=hljs.highlightAuto(r).value,e.parentNode.insertBefore(t,e.nextSibling),e.parentNode.removeChild(e)):e.innerHTML=r})};
|