mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-10 18:45:52 -06:00
17 lines
499 B
TypeScript
17 lines
499 B
TypeScript
import "katex/dist/katex.min.css";
|
|
|
|
export default async function setupMath() {
|
|
const anyMathBlock = document.querySelector("#content .math-tex");
|
|
if (!anyMathBlock) {
|
|
return;
|
|
}
|
|
|
|
const renderMathInElement = (await import("katex/contrib/auto-render")).default;
|
|
await import("katex/contrib/mhchem");
|
|
|
|
const contentEl = document.getElementById("content");
|
|
if (!contentEl) return;
|
|
renderMathInElement(contentEl);
|
|
document.body.classList.add("math-loaded");
|
|
}
|