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 albanpetit committed May 3, 2024
1 parent b168b94 commit c6588c3
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 c6588c3

Please sign in to comment.