Skip to content

Commit c4e01d0

Browse files
committed
Added env flags
1 parent 82f66ae commit c4e01d0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
#VITE_API_BASE=http://localhost:5174
33
#VITE_ENDPOINT_COMPLETIONS=/v1/chat/completions
44
#VITE_ENDPOINT_MODELS=/v1/models
5+
#VITE_RENDER_LATEX=false

src/lib/EditMessage.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
export let message:Message
2020
export let chatId:number
2121
export let chat:Chat
22+
23+
const renderLatexFlag = import.meta.env.VITE_RENDER_LATEX || true
2224
2325
$: chatSettings = chat.settings
2426
@@ -224,6 +226,9 @@
224226
}
225227
226228
const preprocessMath = (text: string): string => {
229+
if (renderLatexFlag !== true) {
230+
return text
231+
}
227232
var codeBlockPlaceholderPrefix = "__prefix__c0d3b10ck__";
228233
while (text.indexOf(codeBlockPlaceholderPrefix) > 0) {
229234
codeBlockPlaceholderPrefix = codeBlockPlaceholderPrefix + "_";

0 commit comments

Comments
 (0)