shithub: hugo

ref: 4730a78a76a5a264f0cd8fc19daed37be5cb2636
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')
  }
}