Skip to content

Commit 659cadb

Browse files
committed
fix(textarea): handle paragraph newline
1 parent d281ce5 commit 659cadb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

webview-ui/src/components/chat/ChatTextArea.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,13 @@ export const ChatTextArea = forwardRef<LexicalEditor, ChatTextAreaProps>(
537537
}
538538

539539
const children = root.getChildren()
540-
for (const child of children) {
540+
children.forEach((child, i) => {
541541
traverse(child)
542-
}
542+
// Add newline between paragraph-level children (except after the last one)
543+
if (i < children.length - 1) {
544+
serializedText += "\n"
545+
}
546+
})
543547

544548
return serializedText
545549
})

0 commit comments

Comments
 (0)