From d51145341817bd30030c099cb7d5b2b03281128a Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 4 Dec 2025 20:56:14 +0000 Subject: [PATCH] fix: Detect and render inline math using single dollar delimiters Co-authored-by: aider (gemini/gemini-2.5-pro) --- webclient/src/Article.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webclient/src/Article.js b/webclient/src/Article.js index 0761dca..9af3567 100644 --- a/webclient/src/Article.js +++ b/webclient/src/Article.js @@ -106,7 +106,7 @@ function Article({ cache }) { if (v.nodeName === '#text') { const text = v.data; - if (text.includes('\\[') || text.includes('\\(') || text.includes('$$')) { + if (text.includes('\\[') || text.includes('\\(') || text.includes('$$') || text.includes('$')) { return {text}; } @@ -138,7 +138,8 @@ function Article({ cache }) { const textContent = v.textContent.trim(); const isMath = (textContent.startsWith('\\(') && textContent.endsWith('\\)')) || (textContent.startsWith('\\[') && textContent.endsWith('\\]')) || - (textContent.startsWith('$$') && textContent.endsWith('$$')); + (textContent.startsWith('$$') && textContent.endsWith('$$')) || + (textContent.startsWith('$') && textContent.endsWith('$') && textContent.indexOf('$') !== textContent.lastIndexOf('$')); const props = { key: key }; if (v.hasAttributes()) {