roadmap/js/code-title.b35124ad8db0ba37...

1 line
318 B
JavaScript
Raw Normal View History

2022-09-07 19:37:39 +00:00
function addTitleToCodeBlocks(){for(var b=document.getElementsByClassName("highlight"),a=0;a<b.length;a++)if(b[a].title.length){let c=document.createElement("div");if(b[a].getElementsByClassName("code-title").length)continue;c.textContent=b[a].title,c.classList.add("code-title"),b[a].insertBefore(c,b[a].firstChild)}}