From 1b9717702b9e461f530f7af8e9ef80a3f0f0a9ae Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 6 Apr 2025 15:13:36 +0200 Subject: [PATCH] sidebar chat: don't process inline latex in dollar signs problematic with inline shell expressions --- .config/ags/modules/.miscutils/md2pango.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/ags/modules/.miscutils/md2pango.js b/.config/ags/modules/.miscutils/md2pango.js index e0eb4d4f6..100699939 100644 --- a/.config/ags/modules/.miscutils/md2pango.js +++ b/.config/ags/modules/.miscutils/md2pango.js @@ -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`; }); }