sync
authorleon <leon@roojs.com>
Mon, 20 Nov 2023 08:08:42 +0000 (16:08 +0800)
committerleon <leon@roojs.com>
Mon, 20 Nov 2023 08:08:42 +0000 (16:08 +0800)
Roo/htmleditor/Filter.js
examples/test.js
roojs-all.js~ [new file with mode: 0644]

index 5213919..347ad2a 100644 (file)
@@ -85,17 +85,17 @@ Roo.htmleditor.Filter.prototype = {
             return;
         }
 
-        Roo.log('WALK TAG');
         var els = dom.getElementsByTagName(this.tag);
         var l = els.length;
-        Roo.log(els.length);
 
         for(var i = 0 ; i < els.length; i++) {
             if(this.replaceTag) {
                 this.replaceTag(els[i]);
             }
-            if(l == els - 1) {
-                l = els - 1;
+
+            // a node is removed
+            if(l != els.length) {
+                l = els.length;
                 i --;
             }
         }
index 01cfd5d..d6a71d2 100644 (file)
@@ -1,9 +1,6 @@
 Roo.onReady(function() {
-    var div = document.createElement('div');
-    div.innerHTML = document.body.innerHTML;
-    new Roo.htmleditor.FilterHashLink({ node : div });
-    new Roo.htmleditor.FilterParagraph({ node : div });
-    new Roo.htmleditor.FilterLongBr({ node : div });
-    new Roo.htmleditor.FilterSpan({ node : div });
-    document.body.appendChild(div);
+    new Roo.htmleditor.FilterHashLink({ node : document.body });
+    new Roo.htmleditor.FilterParagraph({ node : document.body });
+    new Roo.htmleditor.FilterLongBr({ node : document.body });
+    new Roo.htmleditor.FilterSpan({ node : document.body });
 });
\ No newline at end of file
diff --git a/roojs-all.js~ b/roojs-all.js~
new file mode 100644 (file)
index 0000000..e69de29