Skip to content

Commit

Permalink
Apply highlighting to parent element instead
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Sep 29, 2024
1 parent c972033 commit 578c70b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/gh-pages/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function onEachLazy(lazyArray, func) {

function highlightIfNeeded(elem) {
onEachLazy(elem.querySelectorAll("pre > code.language-rust:not(.highlighted)"), el => {
hljs.highlightElement(el)
hljs.highlightElement(el.parentElement)
el.classList.add("highlighted");
});
}
Expand Down

0 comments on commit 578c70b

Please sign in to comment.