浏览代码

fix: prompt editor new line (#6310)

tags/0.6.15
zxhlyh 1年前
父节点
当前提交
23e8043160
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4
    2
      web/app/components/base/prompt-editor/index.tsx

+ 4
- 2
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(() => {

正在加载...
取消
保存