From 5bf7029f0ada5a370f1dfdf6c09b2f977a08609a Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Fri, 3 Feb 2023 17:45:38 +0800 Subject: [PATCH] fix:remove style sheet when paste html --- src/editor/utils/clipboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/utils/clipboard.ts b/src/editor/utils/clipboard.ts index e4e7146..aaf65fb 100644 --- a/src/editor/utils/clipboard.ts +++ b/src/editor/utils/clipboard.ts @@ -142,7 +142,7 @@ export function getElementListByHTML(htmlText: string, options: IGetElementListB if (dom.nodeType === 3) { const style = window.getComputedStyle(dom.parentNode as Element) const value = dom.textContent - if (value) { + if (value && dom.parentNode?.nodeName !== 'STYLE') { elementList.push({ value, color: style.color,