Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: prompt editor new line (#6310)

zxhlyh23e8043160d6
diff --git a/web/app/components/base/prompt-editor/index.tsx b/web/app/components/base/prompt-editor/index.tsx
index 16057ea7d1e..da70d04ac1b 100644
--- a/web/app/components/base/prompt-editor/index.tsx
+++ b/web/app/components/base/prompt-editor/index.tsx
@@ -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(() => {