mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-02-06 11:01:13 +08:00
fix: remove trailing newline when copy from code blocks (#12624)
remove trailing newline when copy from codeblocks Signed-off-by: Fy <haibarafy@163.com>
This commit is contained in:
parent
742fbc555e
commit
ec5bac9d43
@ -128,7 +128,7 @@ export const CodeBlockView: React.FC<Props> = memo(({ children, language, onSave
|
||||
}, [])
|
||||
|
||||
const handleCopySource = useCallback(() => {
|
||||
navigator.clipboard.writeText(children)
|
||||
navigator.clipboard.writeText(children.trimEnd())
|
||||
window.toast.success(t('code_block.copy.success'))
|
||||
}, [children, t])
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user