From 71539e3cb6ab72fcb76f368618223341960ae4c2 Mon Sep 17 00:00:00 2001 From: VictoriaShyika Date: Fri, 8 Dec 2023 01:01:57 +0200 Subject: [PATCH] pasted html converting to nodes --- src/components/main/stageView/iFrame/helpers.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/main/stageView/iFrame/helpers.ts b/src/components/main/stageView/iFrame/helpers.ts index 423af788..dab46104 100644 --- a/src/components/main/stageView/iFrame/helpers.ts +++ b/src/components/main/stageView/iFrame/helpers.ts @@ -1,11 +1,9 @@ -import { ShortDelay } from "@_constants/main"; import { StageNodeIdAttr, TNodeTreeData, TNodeUid, callNodeApi, } from "@_node/index"; -import { debounce } from "lodash"; import { editor } from "monaco-editor"; export const getValidElementWithUid = ( @@ -114,6 +112,7 @@ export const editHtmlContent = ({ ); if (contentEditableElement) { contentEditableElement.setAttribute("contenteditable", "false"); + const content = contentEditableElement.textContent; setIsContentProgrammaticallyChanged(true); callNodeApi( @@ -121,7 +120,7 @@ export const editHtmlContent = ({ action: "text-edit", nodeTree, targetUid: contentEditableUid, - content: contentEditableElement.innerHTML, + content: content ? content : "", codeViewInstanceModel, }, () => {