From: Alan Date: Wed, 28 Feb 2024 08:39:23 +0000 (+0800) Subject: fix #8042 - clean up empty tags X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=93e6e2297355e6c84d5828a36a07c8adaad86743 fix #8042 - clean up empty tags --- diff --git a/.gdb_history b/.gdb_history new file mode 100644 index 0000000000..627be1cc77 --- /dev/null +++ b/.gdb_history @@ -0,0 +1,5 @@ +run -i buildSDK/dependancy_core.txt -i buildSDK/dependancy_ui.txt -i buildSDK/dependancy_bootstrap.txt -i buildSDK/dependancy_calendar.txt -i buildSDK/dependancy_svg.txt --doc-target=docs -D + +up +bt +quit diff --git a/docs/src/Roo_htmleditor_FilterEmpty.js.html b/docs/src/Roo_htmleditor_FilterEmpty.js.html new file mode 100644 index 0000000000..3a72f21092 --- /dev/null +++ b/docs/src/Roo_htmleditor_FilterEmpty.js.html @@ -0,0 +1,44 @@ +Roo/htmleditor/FilterEmpty.js/** + * @class Roo.htmleditor.FilterEmpty + * filter empty elements + * @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.FilterEmpty, Roo.htmleditor.FilterBlack, +{ + + tag : true, + + + replaceTag : function(node) + { + // start from leaf node + if(node.hasChildNodes()) { + this.walk(node); + } + + // only filter empty leaf element with certain tags + if( + ['B', 'I', 'U', 'S'].indexOf(node.tagName) < 0 + || + node.attributes && node.attributes.length > 0 + || + node.hasChildNodes() + ) { + return false; // don't walk + } + + Roo.htmleditor.FilterBlack.prototype.replaceTag.call(this, node); + return false; // don't walk + + } + +}); \ No newline at end of file diff --git a/docs/symbols/Roo.htmleditor.FilterEmpty.json b/docs/symbols/Roo.htmleditor.FilterEmpty.json new file mode 100644 index 0000000000..7f540d3bfe --- /dev/null +++ b/docs/symbols/Roo.htmleditor.FilterEmpty.json @@ -0,0 +1,32 @@ +{ + "name" : "Roo.htmleditor.FilterEmpty", + "augments" : [], + "childClasses" : { }, + "tree_children" : [], + "tree_parent" : [], + "desc" : "filter empty elements", + "isSingleton" : false, + "isStatic" : false, + "isBuiltin" : false, + "isAbstract" : false, + "isBuilderTop" : false, + "memberOf" : "FilterEmpty", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "config", + "type" : "Object", + "desc" : "Configuration options", + "isOptional" : false + } + ], + "returns" : [], + "throws" : "", + "requires" : "", + "config" : [], + "methods" : [], + "events" : [] +} \ No newline at end of file