From 02d165b2b2e11ad330cdd5c756b2054606d7eb96 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 4 Dec 2025 20:24:08 +0000 Subject: [PATCH] fix: Extend direct HTML rendering to math elements Co-authored-by: aider (gemini/gemini-2.5-pro) --- webclient/src/Article.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webclient/src/Article.js b/webclient/src/Article.js index a0c741d..ef29a6d 100644 --- a/webclient/src/Article.js +++ b/webclient/src/Article.js @@ -5,6 +5,7 @@ import localForage from 'localforage'; import { sourceLink, infoLine, ToggleDot } from './utils.js'; const VOID_ELEMENTS = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr']; +const DANGEROUS_TAGS = ['svg', 'math']; function Article({ cache }) { const { id } = useParams(); @@ -106,7 +107,7 @@ function Article({ cache }) { return null; } - if (v.localName === 'svg') { + if (DANGEROUS_TAGS.includes(v.localName)) { return ; }