From df76e34c719ca12b36ce985b35c82efe5a7ee3cf Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Fri, 5 Dec 2025 17:49:03 +0000 Subject: [PATCH] fix: Prevent price false positives in single dollar math detection 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 dde7fb3..88a79f9 100644 --- a/webclient/src/Article.js +++ b/webclient/src/Article.js @@ -137,7 +137,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('$') && !/\s/.test(textContent.charAt(textContent.length - 2))); const props = { key: key }; if (v.hasAttributes()) {