mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-06 23:39:27 -05:00
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
|
||||
|
||||
export function replaceInlineLatexWithCodeBlocks(text) {
|
||||
return text.replace(/\\\[(.*?)\\\]|\\\((.*?)\\\)|\$(.*?)\$/gs, (match, square, round, dollar) => {
|
||||
const latex = square || round || dollar;
|
||||
return text.replace(/\\\[(.*?)\\\]|\\\((.*?)\\\)/gs, (match, square, round) => {
|
||||
const latex = square || round;
|
||||
return `\n\`\`\`latex\n${latex}\n\`\`\`\n`;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user