Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
ebce0069
"src/vscode:/vscode.git/clone" did not exist on "e627b8bf21d2eb5f78f753ed6896ea9255d9e2eb"
Commit
ebce0069
authored
Jul 20, 2024
by
Timothy J. Baek
Browse files
refac: latex handling
parent
d3c6bfb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
src/lib/components/chat/Messages/ResponseMessage.svelte
src/lib/components/chat/Messages/ResponseMessage.svelte
+1
-0
src/lib/utils/index.ts
src/lib/utils/index.ts
+3
-0
No files found.
src/lib/components/chat/Messages/ResponseMessage.svelte
View file @
ebce0069
...
...
@@ -178,6 +178,7 @@
{ left: '\\pu{', right: '}', display: false },
{ left: '\\ce{', right: '}', display: false },
{ left: '\\(', right: '\\)', display: false },
{ left: '( ', right: ' )', display: false },
{ left: '\\[', right: '\\]', display: false },
{ left: '[ ', right: ' ]', display: false },
{ left: '\\begin{equation}', right: '\\end{equation}', display: true },
...
...
src/lib/utils/index.ts
View file @
ebce0069
...
...
@@ -7,6 +7,9 @@ import { WEBUI_BASE_URL } from '$lib/constants';
//////////////////////////
export
const
sanitizeResponseContent
=
(
content
:
string
)
=>
{
// replace single backslash with double backslash
content
=
content
.
replace
(
/
\\
/g
,
'
\\\\
'
);
// First, temporarily replace valid <video> tags with a placeholder
const
videoTagRegex
=
/<video
\s
+src="
([^
"
]
+
)
"
\s
+controls><
\/
video>/gi
;
const
placeholders
:
string
[]
=
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment