mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 03:16:51 +08:00
fix: prompt editor new line (#6310)
This commit is contained in:
@@ -122,9 +122,11 @@ const PromptEditor: FC<PromptEditorProps> = ({
|
||||
}
|
||||
|
||||
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)
|
||||
onChange(text.replaceAll('\n\n', '\n'))
|
||||
onChange(text)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user