From 218f591a5df84bebf244aac9650e777097447079 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Fri, 29 Mar 2024 21:01:04 +0800 Subject: [PATCH] fix: prompt editor linebreak (#3036) --- web/app/components/base/prompt-editor/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/app/components/base/prompt-editor/index.tsx b/web/app/components/base/prompt-editor/index.tsx index c0ff99e4d8..90bc35ac9e 100644 --- a/web/app/components/base/prompt-editor/index.tsx +++ b/web/app/components/base/prompt-editor/index.tsx @@ -9,6 +9,7 @@ import { $getRoot, TextNode, } from 'lexical' +import { CodeNode } from '@lexical/code' import { LexicalComposer } from '@lexical/react/LexicalComposer' import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin' import { ContentEditable } from '@lexical/react/LexicalContentEditable' @@ -118,6 +119,7 @@ const PromptEditor: FC = ({ const initialConfig = { namespace: 'prompt-editor', nodes: [ + CodeNode, CustomTextNode, { replace: TextNode,