From b780fbd6a77ac25e3137255fb6ce931092089f01 Mon Sep 17 00:00:00 2001 From: heheer Date: Tue, 14 Jan 2025 17:24:16 +0800 Subject: [PATCH] fix lexical editor space (#3586) * fix lexical editor space * delete console --- packages/web/components/common/Input/HttpInput/index.tsx | 4 ++-- .../web/components/common/Textarea/PromptEditor/index.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/web/components/common/Input/HttpInput/index.tsx b/packages/web/components/common/Input/HttpInput/index.tsx index 39dc54e71..ca22f048f 100644 --- a/packages/web/components/common/Input/HttpInput/index.tsx +++ b/packages/web/components/common/Input/HttpInput/index.tsx @@ -31,7 +31,7 @@ const HttpInput = ({ const onChangeInput = useCallback( (editorState: EditorState, editor: LexicalEditor) => { - const text = editorStateToText(editor).replaceAll('}}{{', '}} {{'); + const text = editorStateToText(editor); setCurrentValue(text); onChange?.(text); }, @@ -39,7 +39,7 @@ const HttpInput = ({ ); const onBlurInput = useCallback( (editor: LexicalEditor) => { - const text = editorStateToText(editor).replaceAll('}}{{', '}} {{'); + const text = editorStateToText(editor); onBlur?.(text); }, [onBlur] diff --git a/packages/web/components/common/Textarea/PromptEditor/index.tsx b/packages/web/components/common/Textarea/PromptEditor/index.tsx index cf8d0cb2f..c000253a2 100644 --- a/packages/web/components/common/Textarea/PromptEditor/index.tsx +++ b/packages/web/components/common/Textarea/PromptEditor/index.tsx @@ -40,14 +40,14 @@ const PromptEditor = ({ const onChangeInput = useCallback( (editorState: EditorState, editor: LexicalEditor) => { - const text = editorStateToText(editor).replaceAll('}}{{', '}} {{'); + const text = editorStateToText(editor); onChange?.(text); }, [onChange] ); const onBlurInput = useCallback( (editor: LexicalEditor) => { - const text = editorStateToText(editor).replaceAll('}}{{', '}} {{'); + const text = editorStateToText(editor); onBlur?.(text); }, [onBlur]