forked from Shinonome/dots-hyprland
sidebar chat: don't process inline latex in dollar signs
problematic with inline shell expressions
This commit is contained in:
@@ -49,8 +49,8 @@ const replaceCategory = (text, replaces) => {
|
|||||||
// Main function
|
// Main function
|
||||||
|
|
||||||
export function replaceInlineLatexWithCodeBlocks(text) {
|
export function replaceInlineLatexWithCodeBlocks(text) {
|
||||||
return text.replace(/\\\[(.*?)\\\]|\\\((.*?)\\\)|\$(.*?)\$/gs, (match, square, round, dollar) => {
|
return text.replace(/\\\[(.*?)\\\]|\\\((.*?)\\\)/gs, (match, square, round) => {
|
||||||
const latex = square || round || dollar;
|
const latex = square || round;
|
||||||
return `\n\`\`\`latex\n${latex}\n\`\`\`\n`;
|
return `\n\`\`\`latex\n${latex}\n\`\`\`\n`;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user