From f43a7236d3736efbf0392436080bf9a119807687 Mon Sep 17 00:00:00 2001 From: shaoyongjun Date: Wed, 6 Nov 2024 19:32:50 +0800 Subject: [PATCH] to:sync --- static/js/event/impl/ApplyStyleEventImpl.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/event/impl/ApplyStyleEventImpl.js b/static/js/event/impl/ApplyStyleEventImpl.js index 20881a7..9bc4c22 100644 --- a/static/js/event/impl/ApplyStyleEventImpl.js +++ b/static/js/event/impl/ApplyStyleEventImpl.js @@ -80,8 +80,8 @@ define(function (require, exports, module) { continue } let firstItem = curSpanContent.childNodes[0]; - console.log("curSpanContent : ", curSpanContent, curSpanContent.childNodes.length, firstItem.nodeName, firstItem.nodeType); - let isEmptyStyle = curSpanContent.childNodes.length === 1 && firstItem.nodeName === "#text" && firstItem.nodeType === 3; + let isEmptyStyle =/* curSpanContent.childNodes.length === 1 &&*/ firstItem.nodeName === "#text" ;/*&& firstItem.nodeType === 3*/ + console.log("curSpanContent : ", curSpanContent, curSpanContent.childNodes.length, firstItem.nodeName, firstItem.nodeType, isEmptyStyle); if (isEmptyStyle) { let copySpan = curSpanContent.cloneNode(); copySpan.innerHTML = ""; @@ -160,8 +160,8 @@ define(function (require, exports, module) { //光标保持 curS.removeAllRanges(); let newR = document.createRange(); - newR.setStart(copyRange.startContainer,start); - newR.setEnd(copyRange.endContainer,end); + newR.setStart(copyRange.startContainer, start); + newR.setEnd(copyRange.endContainer, end); curS.addRange(newR); }