mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 21:35:52 +08:00
fix(translate): 去除翻译页面中生成的翻译内容开始的空白行 (#3684)
fix(translate): trim whitespace from translated text before setting result
This commit is contained in:
parent
30edbb9b39
commit
1a3329eeb2
@ -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…
Reference in New Issue
Block a user