Skip to content

Commit 5aa329b

Browse files
authored
fix: pasted variables not displaying properly (#783)
## Problem When copying and pasting variables, the pasted variables render as an empty pill. <img width="612" alt="image" src="https://github.com/user-attachments/assets/7b6c56c5-59f3-48fa-ba71-535d2708e37a"> ## Solution Substitute variables according when pasting
1 parent a0a5f21 commit 5aa329b

File tree

1 file changed

+5
-0
lines changed
  • packages/frontend/src/components/RichTextEditor

1 file changed

+5
-0
lines changed

packages/frontend/src/components/RichTextEditor/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ const Editor = ({
167167
const editorElement = editor.view.dom as HTMLElement
168168
editorElement.style.minHeight = isRich ? '9rem' : '2.625rem' // Set initial minHeight directly
169169
},
170+
editorProps: {
171+
transformPastedHTML: (html) => {
172+
return substituteOldTemplates(html, varInfo)
173+
},
174+
},
170175
})
171176
useEffect(() => {
172177
// have to listen to editable as this element might not re-render upon

0 commit comments

Comments
 (0)