From 361aa4f42524692092b2457d236a584e81252581 Mon Sep 17 00:00:00 2001 From: Alan Date: Mon, 4 Dec 2023 11:36:52 +0800 Subject: [PATCH] fix #7922 - span inside span isue with last change --- Roo/htmleditor/Filter.js | 3 +++ roojs-all.js | 2 +- roojs-bootstrap-debug.js | 3 +++ roojs-bootstrap.js | 2 +- roojs-debug.js | 3 +++ roojs-ui-debug.js | 3 +++ roojs-ui.js | 2 +- 7 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Roo/htmleditor/Filter.js b/Roo/htmleditor/Filter.js index 46035687b7..e1a89cbc7f 100644 --- a/Roo/htmleditor/Filter.js +++ b/Roo/htmleditor/Filter.js @@ -88,6 +88,9 @@ Roo.htmleditor.Filter.prototype = { var els = dom.getElementsByTagName(this.tag); Roo.each(Array.from(els), function(e){ + if(e.parentNode == null) { + return; + } if(this.replaceTag) { this.replaceTag(e); } diff --git a/roojs-all.js b/roojs-all.js index 9c448c7c7a..d2b49a3cab 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1897,7 +1897,7 @@ Roo.htmleditor={}; Roo.htmleditor.Filter=function(A){Roo.apply(this.cfg);};Roo.htmleditor.Filter.prototype={node:false,tag:false,replaceComment:false,replaceTag:false,walk:function(A){Roo.each(Array.from(A.childNodes),function(e){switch(true){case e.nodeType==8&&this.replaceComment!==false:this.replaceComment(e); return;case e.nodeType!=1:return;case this.tag===true:case e.tagName.indexOf(":")>-1&&typeof(this.tag)=='object'&&this.tag.indexOf(":")>-1:case e.tagName.indexOf(":")>-1&&typeof(this.tag)=='string'&&this.tag==":":case typeof(this.tag)=='object'&&this.tag.indexOf(e.tagName)>-1:case typeof(this.tag)=='string'&&this.tag==e.tagName:if(this.replaceTag&&false===this.replaceTag(e)){return; }if(e.hasChildNodes()){this.walk(e);}return;default:if(e.hasChildNodes()){this.walk(e);}}},this);},removeNodeKeepChildren:function(A){ar=Array.from(A.childNodes);for(var i=0;i-1&&typeof(this.tag)=='object'&&this.tag.indexOf(":")>-1:case e.tagName.indexOf(":")>-1&&typeof(this.tag)=='string'&&this.tag==":":case typeof(this.tag)=='object'&&this.tag.indexOf(e.tagName)>-1:case typeof(this.tag)=='string'&&this.tag==e.tagName:if(this.replaceTag&&false===this.replaceTag(e)){return; }if(e.hasChildNodes()){this.walk(e);}return;default:if(e.hasChildNodes()){this.walk(e);}}},this);},removeNodeKeepChildren:function(A){ar=Array.from(A.childNodes);for(var i=0;i-1&&typeof(this.tag)=='object'&&this.tag.indexOf(":")>-1:case e.tagName.indexOf(":")>-1&&typeof(this.tag)=='string'&&this.tag==":":case typeof(this.tag)=='object'&&this.tag.indexOf(e.tagName)>-1:case typeof(this.tag)=='string'&&this.tag==e.tagName:if(this.replaceTag&&false===this.replaceTag(e)){return; }if(e.hasChildNodes()){this.walk(e);}return;default:if(e.hasChildNodes()){this.walk(e);}}},this);},removeNodeKeepChildren:function(A){ar=Array.from(A.childNodes);for(var i=0;i