Skip to content

Commit 0991f61

Browse files
authored
fix(comment/waline): cannot read property ‘insertBefore’ of null (#1103)
* fix: resolve issue with comments not displaying due to KaTeX and Waline render order * Fix the problem that comment data couldn't be pulled successfully and raise Error "Cannot read property ‘insertBefore’ of null""
1 parent 839fbd0 commit 0991f61

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}}
22
<script>
33
window.addEventListener("DOMContentLoaded", () => {
4-
renderMathInElement(document.body, {
4+
const mainArticleElement = document.querySelector(".main-article");
5+
renderMathInElement(mainArticleElement, {
56
delimiters: [
67
{ left: "$$", right: "$$", display: true },
78
{ left: "$", right: "$", display: false },
@@ -10,4 +11,4 @@
1011
],
1112
ignoredClasses: ["gist"]
1213
});})
13-
</script>
14+
</script>

0 commit comments

Comments
 (0)