fix #7873 - links to footnotes removed on paste
[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     this.searchTag(cfg.node);
14  }
15  
16  Roo.extend(Roo.htmleditor.FilterHashLink, Roo.htmleditor.Filter,
17  {
18       
19      tag : 'A',
20      
21       
22      replaceTag : function(node)
23      {
24          for(var i = 0; i < node.attributes.length; i ++) {
25              var a = node.attributes[i];
26
27              if(a.name.toLowerCase() == 'href' && a.value.startsWith('#')) {
28                  this.removeNodeKeepChildren(node);
29              }
30          }
31          
32          return false;
33  
34      }
35      
36  });