فهرست منبع

fix: prompt editor linebreak (#3036)

zxhlyh 1 سال پیش
والد
کامیت
218f591a5d
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      web/app/components/base/prompt-editor/index.tsx

+ 2 - 0
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<PromptEditorProps> = ({
   const initialConfig = {
     namespace: 'prompt-editor',
     nodes: [
+      CodeNode,
       CustomTextNode,
       {
         replace: TextNode,