fix: Prevent price false positives in single dollar math detection
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -137,7 +137,8 @@ function Article({ cache }) {
|
|||||||
const textContent = v.textContent.trim();
|
const textContent = v.textContent.trim();
|
||||||
const isMath = (textContent.startsWith('\\(') && textContent.endsWith('\\)')) ||
|
const isMath = (textContent.startsWith('\\(') && textContent.endsWith('\\)')) ||
|
||||||
(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 };
|
const props = { key: key };
|
||||||
if (v.hasAttributes()) {
|
if (v.hasAttributes()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user