github.com/shohhei1126/hugo@v0.42.2-0.20180623210752-3d5928889ad7/docs/themes/gohugoioTheme/src/js/codeblocks.js (about) 1 let article = document.getElementById('prose') 2 3 if (article) { 4 let codeBlocks = article.getElementsByTagName('code') 5 for (let [key, codeBlock] of Object.entries(codeBlocks)){ 6 var widthDif = codeBlock.scrollWidth - codeBlock.clientWidth 7 if (widthDif > 0) 8 codeBlock.parentNode.classList.add('expand') 9 } 10 }