Sfoglia il codice sorgente

fix: prompt editor new line (#6310)

tags/0.6.15
zxhlyh 1 anno fa
parent
commit
23e8043160
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4
    2
      web/app/components/base/prompt-editor/index.tsx

+ 4
- 2
web/app/components/base/prompt-editor/index.tsx Vedi File

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

Loading…
Annulla
Salva