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(".element code").forEach(function(e,n){formatCode(e)}),document.querySelectorAll(".element xmp").forEach(function(e,n){var o=e.innerHTML.match(/\s*\n[\t\s]*/),t=e.innerHTML.replace(new RegExp(o,"g"),"\n"),r=document.createElement("code");"undefined"!=typeof hljs?(r.innerHTML=hljs.highlightAuto(t).value,e.parentNode.insertBefore(r,e.nextSibling),e.parentNode.removeChild(e)):e.innerHTML=t})};
|