fix(translate): 去除翻译页面中生成的翻译内容开始的空白行 (#3684)
fix(translate): trim whitespace from translated text before setting result
This commit is contained in:
parent
cd6c0a1f66
commit
6fd5ff991d
@ -112,8 +112,8 @@ const TranslatePage: FC = () => {
|
|||||||
message,
|
message,
|
||||||
assistant,
|
assistant,
|
||||||
onResponse: (text) => {
|
onResponse: (text) => {
|
||||||
translatedText = text
|
translatedText = text.replace(/^\s*\n+/g, '')
|
||||||
setResult(text)
|
setResult(translatedText)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user