ソースを参照

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

読み込み中…
キャンセル
保存