Skip to content

Commit 2489f1c

Browse files
committed
fix highlight
1 parent 537c68a commit 2489f1c

File tree

1 file changed

+5
-3
lines changed
  • scaladoc/resources/dotty_res/scripts

1 file changed

+5
-3
lines changed

scaladoc/resources/dotty_res/scripts/ux.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ function attachAllListeners() {
128128
}
129129
}
130130

131-
hljs.registerLanguage("scala", highlightDotty);
132-
hljs.registerAliases(["dotty", "scala3"], "scala");
133-
hljs.initHighlighting();
131+
document.querySelectorAll('pre code').forEach(el => {
132+
hljs.highlightBlock(el);
133+
});
134134

135135
/* listen for the `F` key to be pressed, to focus on the member filter input (if it's present) */
136136
document.body.addEventListener('keydown', e => {
@@ -150,6 +150,8 @@ function attachAllListeners() {
150150
}
151151

152152
window.addEventListener("DOMContentLoaded", () => {
153+
hljs.registerLanguage("scala", highlightDotty);
154+
hljs.registerAliases(["dotty", "scala3"], "scala");
153155
attachAllListeners()
154156
});
155157

0 commit comments

Comments
 (0)