mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-24 07:39:27 +01:00
refac: katex
This commit is contained in:
@@ -25,7 +25,8 @@ const convertLatexToSingleLine = (content) => {
|
||||
|
||||
export const sanitizeResponseContent = (content: string) => {
|
||||
// replace single backslash with double backslash
|
||||
content = content.replace(/\\/g, '\\\\');
|
||||
content = content.replace(/\\\\/g, '\\\\\\\\');
|
||||
|
||||
content = convertLatexToSingleLine(content);
|
||||
|
||||
// First, temporarily replace valid <video> tags with a placeholder
|
||||
@@ -87,7 +88,7 @@ export const replaceTokens = (content, char, user) => {
|
||||
};
|
||||
|
||||
export const revertSanitizedResponseContent = (content: string) => {
|
||||
return content.replaceAll('<', '<').replaceAll('>', '>');
|
||||
return content.replaceAll('<', '<').replaceAll('>', '>').replaceAll('\\\\', '\\');
|
||||
};
|
||||
|
||||
export function unescapeHtml(html: string) {
|
||||
|
||||
Reference in New Issue
Block a user