fix dialog on htmleditor link
authorAlan <alan@roojs.com>
Tue, 18 Jan 2022 03:34:08 +0000 (11:34 +0800)
committerAlan <alan@roojs.com>
Tue, 18 Jan 2022 03:34:08 +0000 (11:34 +0800)
Roo/htmleditor/FilterEmpty.js [new file with mode: 0644]

diff --git a/Roo/htmleditor/FilterEmpty.js b/Roo/htmleditor/FilterEmpty.js
new file mode 100644 (file)
index 0000000..642f992
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * @class Roo.htmleditor.FilterEmpty
+ * filter empty elements (normally <B> on paste)
+ * @constructor
+ * Run a new Empty Filter
+ * @param {Object} config Configuration options
+ */
+
+Roo.htmleditor.FilterEmpty = function(cfg)
+{
+    // no need to apply config.
+    this.walk(cfg.node);
+}
+
+Roo.extend(Roo.htmleditor.FilterSpan, Roo.htmleditor.FilterBlack,
+{
+     
+    tag : 'B',
+     
+    replaceTag : function(node)
+    {
+        if (node.innerHTML.trim() != '') {
+            return true;
+        }
+        if (node.attributes && node.attributes.length > 0) {
+            return true; // walk if there are any.
+        }
+        Roo.htmleditor.FilterBlack.prototype.replaceTag.call(this, node);
+        return false;
+     
+    }
+    
+});
\ No newline at end of file