This commit is contained in:
team3
2026-07-10 16:29:35 +02:00
parent 718c18523d
commit a50fb701b5
8 changed files with 115 additions and 41 deletions

View File

@@ -16,10 +16,15 @@ const marked = new Marked(
})
)
// LaTeX-Gewohnheiten aus Vorlesungsskripten normalisieren, die KaTeX nicht
// kennt — synchron halten mit backend/katex_check.mjs
const MACROS = { '\\textsc': '\\text{#1}' }
function kx(tex, displayMode) {
// Newlines im KaTeX-HTML falten (\sqrt-SVG ist mehrzeilig): in Markdown-
// Überschriften endet der Block sonst an der Zeile und das SVG zerreißt
return katex.renderToString(tex, { displayMode }).replace(/\n/g, ' ')
return katex.renderToString(tex, { displayMode, macros: { ...MACROS } })
.replace(/\n/g, ' ')
}
function mathe(text) {