fix #7861 - add multiline combobox MultiLineTag
[roojs1] / Roo / htmleditor / FilterHashLink.js
1 /**
2  * @class Roo.htmleditor.FilterHashLink
3  * remove hash link
4  * @constructor
5  * Run a new Hash Link Filter
6  * @param {Object} config Configuration options
7  */
8
9  Roo.htmleditor.FilterHashLink = function(cfg)
10  {
11      // no need to apply config.
12      this.walk(cfg.node);
13  }
14  
15  Roo.extend(Roo.htmleditor.FilterHashLink, Roo.htmleditor.Filter,
16  {
17       
18      tag : 'A',
19      
20       
21      replaceTag : function(node)
22      {
23          for(var i = 0; i < node.attributes.length; i ++) {
24              var a = node.attributes[i];
25
26              if(a.name.toLowerCase() == 'href' && a.value.startsWith('#')) {
27                  var ar = Array.from(node.childNodes);
28                  for (var i = 0; i < ar.length; i++) {
29                      node.parentNode.insertBefore(ar[i], node);
30                  }
31                  
32                  node.parentNode.removeChild(node);
33              }
34          }
35          
36          return false;
37  
38      }
39      
40  });