mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-11 19:39:57 -05:00
ai: actually make chat messages update incrementally
(instead of destroying and recreating every update) MUCH better performance and no more hundreds of latex files for one integration by parts work
This commit is contained in:
@@ -49,7 +49,7 @@ const replaceCategory = (text, replaces) => {
|
||||
// Main function
|
||||
|
||||
export function replaceInlineLatexWithCodeBlocks(text) {
|
||||
return text.replace(/\\\[(.*?)\\\]|\\\((.*?)\\\)|\$\$(.*?)\$\$|(?<!\w)\$(.*?[^\\])\$(?!\w)/gs, (match, square, round, double, single) => {
|
||||
return text.replace(/\\\[(.*?)\\\]|\\\((.*?)\\\)|\$\$(.*?)\$\$|(?:^|[^\w])\$(.*?[^\\])\$(?!\w)/gs, (match, square, round, double, single) => {
|
||||
const latex = square || round || double || single;
|
||||
return `\n\`\`\`latex\n${latex}\n\`\`\`\n`;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user