Skip to content

Commit 0ff6bd1

Browse files
committed
Update KaTeX version and add workaround for scrollbar glitch
1 parent e669f29 commit 0ff6bd1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

katex-header.html

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.css" integrity="sha384-R4558gYOUz8mP9YWpZJjofhk+zx0AS11p36HnD2ZKj/6JR5z27gSSULCNHIRReVs" crossorigin="anonymous">
2-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.js" integrity="sha384-z1fJDqw8ZApjGO3/unPWUPsIymfsJmyrDVWC8Tv/a1HeOtGmkwNd/7xUS0Xcnvsx" crossorigin="anonymous"></script>
1+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css" integrity="sha384-GvrOXuhMATgEsSwCs4smul74iXGOixntILdUW9XmUC6+HX0sLNAK3q71HotJqlAn" crossorigin="anonymous">
2+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.js" integrity="sha384-cpW21h6RZv/phavutF+AuVYrr+dA8xD9zs6FwLpaCct6O9ctzYFfFr4dgmgccOTx" crossorigin="anonymous"></script>
33
<style type="text/css">
44
.katex { font-size: 1.07em; }
5+
/* rustdoc uses "overflow-x: auto" which adds wrong scrollbars, cf. https://github.com/KaTeX/KaTeX/discussions/2942 */
6+
.docblock > :not(.more-examples-toggle):not(.example-wrap) {
7+
overflow-x: visible;
8+
}
59
</style>
610
<script>
711
"use strict";
@@ -21,7 +25,7 @@
2125
}
2226
let span = document.createElement("span");
2327
katex.render(text.substr(1, text.length - 2), span, {displayMode: false, throwOnError: false});
24-
el.parentNode.replaceChild(span, el);
28+
el.parentNode.replaceChild(span.firstChild, el);
2529
});
2630

2731
// comment in code
@@ -49,4 +53,4 @@
4953
children.forEach((child) => el.appendChild(child));
5054
});
5155
});
52-
</script>
56+
</script>

0 commit comments

Comments
 (0)