Roo/form/HtmlEditor.js
authorAlan Knowles <alan@akbkhome.com>
Tue, 16 Aug 2011 02:29:05 +0000 (10:29 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 16 Aug 2011 02:29:05 +0000 (10:29 +0800)
Roo/form/HtmlEditor.js

index fb99a91..9cfe909 100644 (file)
@@ -953,6 +953,18 @@ Roo.form.HtmlEditor = Roo.extend(Roo.form.Field, {
             return;
             
         }
+        if (Roo.form.HtmlEditor.remove.indexOf(node.tagName.toLowerCase()) > -1) {
+            this.cleanUpChildren(node);
+            // inserts everything just before this node...
+            while (node.childNodes.length) {
+                var cn = node.childNodes[0];
+                node.removeChild(cn);
+                node.parent.insertBefore(cn, node);
+            }
+            node.parentNode.removeChild(node);
+            return;
+        }
+        
         if (!node.attributes || !node.attributes.length) {
             this.cleanUpChildren(node);
             return;
@@ -1103,9 +1115,11 @@ Roo.form.HtmlEditor.black = [
         'script', 'style' ,'title',  'xml' // clean later..
 ];
 Roo.form.HtmlEditor.clean = [
-    'script', 'style', 'title', 'xml', 'font'
+    'script', 'style', 'title', 'xml'
+];
+Roo.form.HtmlEditor.remove = [
+    'font'
 ];
-
 // attributes..
 
 Roo.form.HtmlEditor.ablack = [