CaiJimmy / hugo-theme-stack

Card-style Hugo theme designed for bloggers
https://stack.jimmycai.com
GNU General Public License v3.0
5.06k stars 1.66k forks source link

fix: KaTeX may render contents in gist under certain conditions #755

Closed Furffico closed 1 year ago

Furffico commented 1 year ago

This is a bug I met, and it's not difficult to fix, so I fixed it and opened this PR.

Bug description: When the gist is loaded before katex renders, the gist codes between $ are treated by katex as math contents. (The codeblock generated by github gist is not wrapped by any <code> tag.) Below is a screenshot of such render error.

image (Related gist: https://gist.github.com/Furffico/f63e63cc192d77ca3c6bb5347f0a1d63)

Solution: Simply add gist to ignoredClasses option of katex configuration would fix this bug.