Skip to content

Commit

Permalink
Added env flags
Browse files Browse the repository at this point in the history
  • Loading branch information
morgan9e committed Apr 24, 2024
1 parent 82f66ae commit c4e01d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
#VITE_API_BASE=http://localhost:5174
#VITE_ENDPOINT_COMPLETIONS=/v1/chat/completions
#VITE_ENDPOINT_MODELS=/v1/models
#VITE_RENDER_LATEX=false
5 changes: 5 additions & 0 deletions src/lib/EditMessage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
export let message:Message
export let chatId:number
export let chat:Chat
const renderLatexFlag = import.meta.env.VITE_RENDER_LATEX || true
$: chatSettings = chat.settings
Expand Down Expand Up @@ -224,6 +226,9 @@
}
const preprocessMath = (text: string): string => {
if (renderLatexFlag !== true) {
return text
}
var codeBlockPlaceholderPrefix = "__prefix__c0d3b10ck__";

Check warning on line 232 in src/lib/EditMessage.svelte

View workflow job for this annotation

GitHub Actions / lint

Unexpected var, use let or const instead
while (text.indexOf(codeBlockPlaceholderPrefix) > 0) {
codeBlockPlaceholderPrefix = codeBlockPlaceholderPrefix + "_";
Expand Down

0 comments on commit c4e01d0

Please sign in to comment.