chore(share): set up math

This commit is contained in:
Elian Doran
2025-10-24 21:10:31 +03:00
parent b9a4e7ab11
commit e3dd25b591
7 changed files with 24 additions and 13 deletions

View File

@@ -9,15 +9,7 @@ async function ensureJQuery() {
(window as any).$ = $;
}
async function applyMath() {
const anyMathBlock = document.querySelector("#content .math-tex");
if (!anyMathBlock) {
return;
}
const renderMathInElement = (await import("./services/math.js")).renderMathInElement;
renderMathInElement(document.getElementById("content"));
}
async function formatCodeBlocks() {
const anyCodeBlock = document.querySelector("#content pre");
@@ -31,7 +23,6 @@ async function formatCodeBlocks() {
async function setupTextNote() {
formatCodeBlocks();
applyMath();
}
/**

View File

@@ -99,6 +99,7 @@ export function renderNoteContent(note: SNote) {
const cssToLoad: string[] = [];
if (!note.isLabelTruthy("shareOmitDefaultCss")) {
cssToLoad.push(`assets/styles.css`);
cssToLoad.push(`assets/scripts.css`);
cssToLoad.push(`assets/boxicons.css`);
}
for (const cssRelation of note.getRelations("shareCss")) {