1 line
355 B
JavaScript
1 line
355 B
JavaScript
|
function addTitleToCodeBlocks(){const e=document.getElementsByClassName("highlight");for(let t=0;t<e.length;t++)try{if(e[t].title.length){let n=document.createElement("div");if(e[t].getElementsByClassName("code-title").length)continue;n.textContent=e[t].title,n.classList.add("code-title"),e[t].insertBefore(n,e[t].firstChild)}}catch(e){console.debug(e)}}
|