shithub: hugo

ref: f806e951fd7f1c98b1b2b87b35d02525830f5451
dir: /docs/themes/gohugoioTheme/src/js/codeblocks.js/

View raw version
let article = document.getElementById('prose')

if (article) {
  let codeBlocks = article.getElementsByTagName('code')
    for (let [key, codeBlock] of Object.entries(codeBlocks)){
    var widthDif = codeBlock.scrollWidth - codeBlock.clientWidth
    if (widthDif > 0)
      codeBlock.parentNode.classList.add('expand')
  }
}