3 * @class Roo.htmleditor.Filter
4 * Base Class for filtering htmleditor stuff. - do not use this directly - extend it.
5 * @cfg {DomElement} node The node to iterate and filter
6 * @cfg {boolean|String|Array} tag Tags to replace
9 * @param {Object} config Configuration options
14 Roo.htmleditor.Filter = function(cfg) {
16 // this does not actually call walk as it's really just a abstract class
20 Roo.htmleditor.Filter.prototype = {
26 // overrride to do replace comments.
27 replaceComment : false,
29 // overrride to do replace or do stuff with tags..
34 Roo.each( Array.from(dom.childNodes), function( e ) {
37 case e.nodeType == 8 && typeof(this.replaceComment) != 'undefined': // comment
38 this.replaceComment(e);
41 case e.nodeType != 1: //not a node.
44 case this.tag === true: // everything
45 case typeof(this.tag) == 'object' && this.tag.indexOf(e.tagName) > -1: // array and it matches.
46 case typeof(this.tag) == 'string' && this.tag == e.tagName: // array and it matches.
47 if (this.replaceTag && false === this.replaceTag(e)) {
50 if (e.hasChildNodes()) {
55 default: // tags .. that do not match.
56 if (e.hasChildNodes()) {