From 3de6a5d9bc36a1c1b8e1e457719dc89741ef0e71 Mon Sep 17 00:00:00 2001 From: Alan Date: Tue, 18 Jan 2022 11:34:08 +0800 Subject: [PATCH] fix dialog on htmleditor link --- Roo/htmleditor/FilterEmpty.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Roo/htmleditor/FilterEmpty.js diff --git a/Roo/htmleditor/FilterEmpty.js b/Roo/htmleditor/FilterEmpty.js new file mode 100644 index 0000000000..642f9925dd --- /dev/null +++ b/Roo/htmleditor/FilterEmpty.js @@ -0,0 +1,34 @@ +/** + * @class Roo.htmleditor.FilterEmpty + * filter empty elements (normally 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 -- 2.39.2