Skip to content

Instantly share code, notes, and snippets.

@illarionvk
Created November 30, 2013 10:48
Show Gist options
  • Save illarionvk/7717604 to your computer and use it in GitHub Desktop.
Save illarionvk/7717604 to your computer and use it in GitHub Desktop.
Remove vertical scrollbars from Jekyll syntax-highlighted code examples by adding 1px to the wrapper div height.
var codeblocks = document.getElementsByClassName('highlight');
for (var i = 0; i < codeblocks.length; ++i) {
var item = codeblocks[i];
// console.log("Old height:" + " " + item.offsetHeight);
item.style.height = item.offsetHeight + 1 + 'px';
// console.log("New height:" + " " + item.offsetHeight);
}
.highlight {
overflow: auto;
pre code {
font-weight: normal;
white-space: pre;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment