Skip to content

Commit

Permalink
fix: make KaTeX render all math inside document.body (CaiJimmy#994)
Browse files Browse the repository at this point in the history
Since it only accepts one element, I cannot pass `.article-content` and `#TableOfContent` to it. The official documentation uses `document.body` directly, so I guess that's fine.

closes CaiJimmy#882
  • Loading branch information
CaiJimmy authored and ous50 committed Aug 21, 2024
1 parent c832590 commit 3a4962b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layouts/partials/article/components/math.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}}
<script>
window.addEventListener("DOMContentLoaded", () => {
renderMathInElement(document.querySelector(`.article-content`), {
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
Expand Down

0 comments on commit 3a4962b

Please sign in to comment.