Skip to content

Commit e3c8e75

Browse files
committed
perf: skip processChineseContent for non-Chinese content
1 parent 9828f30 commit e3c8e75

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
@@ -104,6 +104,7 @@ function isChineseChar(char: string): boolean {
104104
// Tackle "Model output issue not following the standard Markdown/LaTeX format" in Chinese.
105105
function processChineseContent(content: string): string {
106106
// This function is used to process the response content before the response content is rendered.
107+
if (!/[\u4e00-\u9fa5]/.test(content)) return content;
107108
const lines = content.split('\n');
108109
const processedLines = lines.map((line) => {
109110
if (/[\u4e00-\u9fa5]/.test(line)) {

0 commit comments

Comments
 (0)