fix(translate): 去除翻译页面中生成的翻译内容开始的空白行 (#3684)

fix(translate): trim whitespace from translated text before setting result
This commit is contained in:
FischLu 2025-03-20 14:31:13 +01:00 committed by GitHub
parent cd6c0a1f66
commit 6fd5ff991d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,8 +112,8 @@ const TranslatePage: FC = () => {
message,
assistant,
onResponse: (text) => {
translatedText = text
setResult(text)
translatedText = text.replace(/^\s*\n+/g, '')
setResult(translatedText)
}
})
} catch (error) {