JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.3
[ckeditor.git] / _source / plugins / htmldataprocessor / plugin.js
index 8aad224..ecf87ed 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -308,7 +308,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                // Avoid corrupting the inline event attributes (#7243).\r
                                // We should not rewrite the existed protected attributes, e.g. clipboard content from editor. (#5218)\r
                                if ( !( /^on/ ).test( attrName ) && attributes.indexOf( 'data-cke-saved-' + attrName ) == -1 )\r
-                                       return ' data-cke-saved-' + fullAttr + ' ' + fullAttr;\r
+                                       return ' data-cke-saved-' + fullAttr + ' data-cke-' + CKEDITOR.rnd + '-' + fullAttr;\r
 \r
                                return fullAttr;\r
                        }) + '>';\r
@@ -516,10 +516,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        // Call the browser to help us fixing a possibly invalid HTML\r
                        // structure.\r
                        var div = new CKEDITOR.dom.element( 'div' );\r
+\r
                        // Add fake character to workaround IE comments bug. (#3801)\r
                        div.setHtml( 'a' + data );\r
                        data = div.getHtml().substr( 1 );\r
 \r
+                       // Restore shortly protected attribute names.\r
+                       data = data.replace( new RegExp( ' data-cke-' + CKEDITOR.rnd + '-', 'ig' ), ' ' );\r
+\r
                        // Unprotect "some" of the protected elements at this point.\r
                        data = unprotectElementNames( data );\r
 \r