mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-02 12:31:29 -05:00
11 lines
325 B
JavaScript
11 lines
325 B
JavaScript
|
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')
|
||
|
}
|
||
|
}
|