3 * @class Roo.htmleditor.FilterStyleToTag
4 * part of the word stuff... - certain 'styles' should be converted to tags.
6 * font-weight: bold -> bold
7 * ?? super / subscrit etc..
10 * Run a new style to tag filter.
11 * @param {Object} config Configuration options
13 Roo.htmleditor.FilterStyleToTag = function(cfg)
17 B : [ 'fontWeight' , 'bold'],
18 I : [ 'fontStyle' , 'italic'],
19 //pre : [ 'font-style' , 'italic'],
20 // h1.. h6 ?? font-size?
21 SUP : [ 'verticalAlign' , 'super' ],
22 SUB : [ 'verticalAlign' , 'sub' ]
37 Roo.extend(Roo.htmleditor.FilterStyleToTag, Roo.htmleditor.Filter,
39 tag: true, // all tags
44 replaceTag : function(node)
48 if (node.getAttribute("style") === null) {
52 for (var k in this.tags) {
53 if (node.style[this.tags[k][0]] == this.tags[k][1]) {
55 node.style.removeProperty(this.tags[k][0]);
61 var cn = Array.from(node.childNodes);
63 Roo.each(inject, function(t) {
64 var nc = node.ownerDocument.createElement(t);
68 for(var i = 0;i < cn.length;cn++) {
69 node.removeChild(cn[i]);
70 nn.appendChild(cn[i]);
72 return true /// iterate thru