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
01632775
Commit
01632775
authored
Nov 03, 2023
by
Timothy J. Baek
Browse files
fix: latex markdown rendering
parent
d8d14fbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
src/routes/+page.svelte
src/routes/+page.svelte
+7
-13
No files found.
src/routes/+page.svelte
View file @
01632775
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
const
{
saveAs
}
=
fileSaver
;
const
{
saveAs
}
=
fileSaver
;
import
hljs
from
'
highlight.js
'
;
import
hljs
from
'
highlight.js
'
;
import
'
highlight.js/styles/github-dark.min.css
'
;
import
'
highlight.js/styles/github-dark.min.css
'
;
import
katex
from
'
katex
'
;
import
auto_render
from
'
katex/dist/contrib/auto-render.mjs
'
;
import
auto_render
from
'
katex/dist/contrib/auto-render.mjs
'
;
import
'
katex/dist/katex.min.css
'
;
import
toast
from
'
svelte-french-toast
'
;
import
toast
from
'
svelte-french-toast
'
;
import
{
API_BASE_URL
as
BUILD_TIME_API_BASE_URL
}
from
'
$lib/constants
'
;
import
{
API_BASE_URL
as
BUILD_TIME_API_BASE_URL
}
from
'
$lib/constants
'
;
...
@@ -144,13 +144,12 @@
...
@@ -144,13 +144,12 @@
// • auto-render specific keys, e.g.:
// • auto-render specific keys, e.g.:
delimiters
:
[
delimiters
:
[
{
left
:
'
$$
'
,
right
:
'
$$
'
,
display
:
true
},
{
left
:
'
$$
'
,
right
:
'
$$
'
,
display
:
true
},
{
left
:
'
$
'
,
right
:
'
$
'
,
display
:
fals
e
},
{
left
:
'
$
'
,
right
:
'
$
'
,
display
:
tru
e
},
{
left
:
'
\\
(
'
,
right
:
'
\\
)
'
,
display
:
fals
e
},
{
left
:
'
\\
(
'
,
right
:
'
\\
)
'
,
display
:
tru
e
},
{
left
:
'
\\
[
'
,
right
:
'
\\
]
'
,
display
:
true
}
{
left
:
'
\\
[
'
,
right
:
'
\\
]
'
,
display
:
true
}
],
],
// • rendering keys, e.g.:
// • rendering keys, e.g.:
throwOnError
:
false
,
throwOnError
:
false
output
:
'
mathml
'
});
});
}
}
};
};
...
@@ -223,9 +222,10 @@
...
@@ -223,9 +222,10 @@
settings
.
temperature
=
chat
.
temperature
??
settings
.
temperature
;
settings
.
temperature
=
chat
.
temperature
??
settings
.
temperature
;
await
tick
();
await
tick
();
renderLatex
();
hljs
.
highlightAll
();
hljs
.
highlightAll
();
createCopyCodeBlockButton
();
createCopyCodeBlockButton
();
renderLatex
();
}
}
};
};
...
@@ -893,7 +893,7 @@
...
@@ -893,7 +893,7 @@
{message.content}
{message.content}
{/if}
{/if}
{:else}
{:else}
{@html marked
.parse
(message.content)}
{@html marked(message.content
.replace('\\\\', '\\\\\\')
)}
{#if message.done}
{#if message.done}
<div
class=
" flex justify-end space-x-1 text-gray-400"
>
<div
class=
" flex justify-end space-x-1 text-gray-400"
>
...
@@ -1122,12 +1122,6 @@
...
@@ -1122,12 +1122,6 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
" hidden katex"
/>
<!-- <main class="w-full flex justify-center">
<div class="max-w-lg w-screen p-5" />
</main> -->
</div>
</div>
</div>
</div>
...
...
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