From a4cecc8519dc8677ac8952509c31a9a4bcd4e11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Thu, 22 Oct 2026 13:59:05 +0200 Subject: [PATCH] explorer: Fix math rendering in markdown The sanitizer allowlist added in 4c31a8134 strips all of KaTeX's markup, leaving only the flat text of each formula. We now typeset math after sanitizing instead of loosening the allowlist for spans and styles. --- explorer/src/components/Markdown.svelte | 20 ++---- explorer/src/lib/markdown.ts | 63 ++++++++++++++++++- explorer/tests/unit/markdown.test.ts | 39 ++++++++++++ .../tests/visual/desktop/markdown.spec.ts | 1 + 4 files changed, 106 insertions(+), 17 deletions(-) create mode 100644 explorer/tests/unit/markdown.test.ts diff --git a/explorer/src/components/Markdown.svelte b/explorer/src/components/Markdown.svelte index 05ceeacde..0103b34e7 100644 --- a/explorer/src/components/Markdown.svelte +++ b/explorer/src/components/Markdown.svelte @@ -22,7 +22,6 @@