Skip to content

Commit 354a179

Browse files
perf: skip processChineseContent for non-Chinese content (open-webui#23162)
1 parent b898fc0 commit 354a179

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/lib/utils/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ function isChineseChar(char: string): boolean {
103103
// Tackle "Model output issue not following the standard Markdown/LaTeX format" in Chinese.
104104
function processChineseContent(content: string): string {
105105
// This function is used to process the response content before the response content is rendered.
106+
if (!/[\u4e00-\u9fa5]/.test(content)) return content;
106107
const lines = content.split('\n');
107108
const processedLines = lines.map((line) => {
108109
if (/[\u4e00-\u9fa5]/.test(line)) {

0 commit comments

Comments
 (0)