fix: Detect and render inline math using single dollar delimiters
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -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 <Latex key={key} delimiters={latexDelimiters}>{text}</Latex>;
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user