mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-07 02:58:21 +00:00
perf: skip replaceTokens when no {{ present (#23161)
This commit is contained in:
parent
04919757e4
commit
16e6cb458f
1 changed files with 1 additions and 0 deletions
|
|
@ -53,6 +53,7 @@ export const replaceOutsideCode = (content: string, replacer: (str: string) => s
|
|||
};
|
||||
|
||||
export const replaceTokens = (content, char, user) => {
|
||||
if (!content.includes('{{')) return content;
|
||||
const tokens = [
|
||||
{ regex: /{{char}}/gi, replacement: char },
|
||||
{ regex: /{{user}}/gi, replacement: user },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue