Unverified Commit a58dfccb authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #4273 from open-webui/dev

0.3.11
parents 82079e64 b3529322
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -145,6 +145,7 @@ type Config = {
auth: boolean;
auth_trusted_header: boolean;
enable_signup: boolean;
enable_login_form: boolean;
enable_web_search?: boolean;
enable_image_generation: boolean;
enable_admin_export: boolean;
......
......@@ -6,7 +6,28 @@ import { WEBUI_BASE_URL } from '$lib/constants';
// Helper functions
//////////////////////////
const convertLatexToSingleLine = (content) => {
// Patterns to match multiline LaTeX blocks
const patterns = [
/(\$\$[\s\S]*?\$\$)/g, // Match $$ ... $$
/(\\\[[\s\S]*?\\\])/g, // Match \[ ... \]
/(\\begin\{[a-z]+\}[\s\S]*?\\end\{[a-z]+\})/g // Match \begin{...} ... \end{...}
];
patterns.forEach((pattern) => {
content = content.replace(pattern, (match) => {
return match.replace(/\s*\n\s*/g, ' ').trim();
});
});
return content;
};
export const sanitizeResponseContent = (content: string) => {
// replace single backslash with double backslash
content = content.replace(/\\/g, '\\\\');
content = convertLatexToSingleLine(content);
// First, temporarily replace valid <video> tags with a placeholder
const videoTagRegex = /<video\s+src="([^"]+)"\s+controls><\/video>/gi;
const placeholders: string[] = [];
......
This diff is collapsed.
This diff is collapsed.
......@@ -110,7 +110,7 @@
await WEBUI_NAME.set(backendConfig.name);
if ($config) {
const _socket = io(`${WEBUI_BASE_URL}`, {
const _socket = io(`${WEBUI_BASE_URL}` || undefined, {
path: '/ws/socket.io',
auth: { token: localStorage.token }
});
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment