mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 21:15:52 +08:00
fix: prompt editor new line (#6310)
This commit is contained in:
parent
d66d7146a3
commit
23e8043160
@ -122,9 +122,11 @@ const PromptEditor: FC<PromptEditorProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleEditorChange = (editorState: EditorState) => {
|
const handleEditorChange = (editorState: EditorState) => {
|
||||||
const text = editorState.read(() => $getRoot().getTextContent())
|
const text = editorState.read(() => {
|
||||||
|
return $getRoot().getChildren().map(p => p.getTextContent()).join('\n')
|
||||||
|
})
|
||||||
if (onChange)
|
if (onChange)
|
||||||
onChange(text.replaceAll('\n\n', '\n'))
|
onChange(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user