fix: paste and format element boundary error

This commit is contained in:
Hufe921
2023-04-24 14:23:12 +08:00
parent ef9ee07a55
commit 86569f51d3
4 changed files with 114 additions and 106 deletions
+1 -1
View File
@@ -353,7 +353,7 @@ export function getElementListByHTML(htmlText: string, options: IGetElementListB
document.body.appendChild(clipboardDom)
const deleteNodes: ChildNode[] = []
clipboardDom.childNodes.forEach(child => {
if (child.nodeType !== 1) {
if (child.nodeType !== 1 && !child.textContent?.trim()) {
deleteNodes.push(child)
}
})