right now. // TODO: Support filler for , line break is also occupy line height. delete blockLikeTags.pre; var defaultDataFilterRules = { elements : {}, attributeNames : [ // Event attributes (onXYZ) must not be directly set. They can become // active in the editing area (IE|WebKit). [ ( /^on/ ), 'data-cke-pa-on' ] ] }; var defaultDataBlockFilterRules = { elements : {} }; for ( i in blockLikeTags ) defaultDataBlockFilterRules.elements[ i ] = getBlockExtension(); var defaultHtmlFilterRules = { elementNames : [ // Remove the "cke:" namespace prefix. [ ( /^cke:/ ), '' ], // Ignore tags. [ ( /^\?xml:namespace$/ ), '' ] ], attributeNames : [ // Attributes saved for changes and protected attributes. [ ( /^data-cke-(saved|pa)-/ ), '' ], // All "data-cke-" attributes are to be ignored. [ ( /^data-cke-.*/ ), '' ], [ 'hidefocus', '' ] ], elements : { $ : function( element ) { var attribs = element.attributes; if ( attribs ) { // Elements marked as temporary are to be ignored. if ( attribs[ 'data-cke-temp' ] ) return false; // Remove duplicated attributes - #3789. var attributeNames = [ 'name', 'href', 'src' ], savedAttributeName; for ( var i = 0 ; i < attributeNames.length ; i++ ) { savedAttributeName = 'data-cke-saved-' + attributeNames[ i ]; savedAttributeName in attribs && ( delete attribs[ attributeNames[ i ] ] ); } } return element; }, // The contents of table should be in correct order (#4809). table : function( element ) { var children = element.children; children.sort( function ( node1, node2 ) { return node1.type == CKEDITOR.NODE_ELEMENT && node2.type == node1.type ? CKEDITOR.tools.indexOf( tableOrder, node1.name ) > CKEDITOR.tools.indexOf( tableOrder, node2.name ) ? 1 : -1 : 0; } ); }, embed : function( element ) { var parent = element.parent; // If the is child of a , copy the width // and height attributes from it. if ( parent && parent.name == 'object' ) { var parentWidth = parent.attributes.width, parentHeight = parent.attributes.height; parentWidth && ( element.attributes.width = parentWidth ); parentHeight && ( element.attributes.height = parentHeight ); } }, // Restore param elements into self-closing. param : function( param ) { param.children = []; param.isEmpty = true; return param; }, // Remove empty link but not empty anchor.(#3829) a : function( element ) { if ( !( element.children.length || element.attributes.name || element.attributes[ 'data-cke-saved-name' ] ) ) { return false; } }, // Remove dummy span in webkit. span: function( element ) { if ( element.attributes[ 'class' ] == 'Apple-style-span' ) delete element.name; }, // Empty in IE is reported with filler node ( ). pre : function( element ) { CKEDITOR.env.ie && trimFillers( element ); }, html : function( element ) { delete element.attributes.contenteditable; delete element.attributes[ 'class' ]; }, body : function( element ) { delete element.attributes.spellcheck; delete element.attributes.contenteditable; }, style : function( element ) { var child = element.children[ 0 ]; child && child.value && ( child.value = CKEDITOR.tools.trim( child.value )); if ( !element.attributes.type ) element.attributes.type = 'text/css'; }, title : function( element ) { var titleText = element.children[ 0 ]; titleText && ( titleText.value = element.attributes[ 'data-cke-title' ] || '' ); } }, attributes : { 'class' : function( value, element ) { // Remove all class names starting with "cke_". return CKEDITOR.tools.ltrim( value.replace( /(?:^|\s+)cke_[^\s]*/g, '' ) ) || false; } } }; if ( CKEDITOR.env.ie ) { // IE outputs style attribute in capital letters. We should convert // them back to lower case, while not hurting the values (#5930) defaultHtmlFilterRules.attributes.style = function( value, element ) { return value.replace( /(^|;)([^\:]+)/g, function( match ) { return match.toLowerCase(); }); }; } function protectReadOnly( element ) { var attrs = element.attributes; // We should flag that the element was locked by our code so // it'll be editable by the editor functions (#6046). if ( attrs.contenteditable != "false" ) attrs[ 'data-cke-editable' ] = attrs.contenteditable ? 'true' : 1; attrs.contenteditable = "false"; } function unprotectReadyOnly( element ) { var attrs = element.attributes; switch( attrs[ 'data-cke-editable' ] ) { case 'true': attrs.contenteditable = 'true'; break; case '1': delete attrs.contenteditable; break; } } // Disable form elements editing mode provided by some browers. (#5746) for ( i in { input : 1, textarea : 1 } ) { defaultDataFilterRules.elements[ i ] = protectReadOnly; defaultHtmlFilterRules.elements[ i ] = unprotectReadyOnly; } var protectElementRegex = /<(a|area|img|input)\b([^>]*)>/gi, protectAttributeRegex = /\b(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi; var protectElementsRegex = /(?:
, line break is also occupy line height. delete blockLikeTags.pre; var defaultDataFilterRules = { elements : {}, attributeNames : [ // Event attributes (onXYZ) must not be directly set. They can become // active in the editing area (IE|WebKit). [ ( /^on/ ), 'data-cke-pa-on' ] ] }; var defaultDataBlockFilterRules = { elements : {} }; for ( i in blockLikeTags ) defaultDataBlockFilterRules.elements[ i ] = getBlockExtension(); var defaultHtmlFilterRules = { elementNames : [ // Remove the "cke:" namespace prefix. [ ( /^cke:/ ), '' ], // Ignore tags. [ ( /^\?xml:namespace$/ ), '' ] ], attributeNames : [ // Attributes saved for changes and protected attributes. [ ( /^data-cke-(saved|pa)-/ ), '' ], // All "data-cke-" attributes are to be ignored. [ ( /^data-cke-.*/ ), '' ], [ 'hidefocus', '' ] ], elements : { $ : function( element ) { var attribs = element.attributes; if ( attribs ) { // Elements marked as temporary are to be ignored. if ( attribs[ 'data-cke-temp' ] ) return false; // Remove duplicated attributes - #3789. var attributeNames = [ 'name', 'href', 'src' ], savedAttributeName; for ( var i = 0 ; i < attributeNames.length ; i++ ) { savedAttributeName = 'data-cke-saved-' + attributeNames[ i ]; savedAttributeName in attribs && ( delete attribs[ attributeNames[ i ] ] ); } } return element; }, // The contents of table should be in correct order (#4809). table : function( element ) { var children = element.children; children.sort( function ( node1, node2 ) { return node1.type == CKEDITOR.NODE_ELEMENT && node2.type == node1.type ? CKEDITOR.tools.indexOf( tableOrder, node1.name ) > CKEDITOR.tools.indexOf( tableOrder, node2.name ) ? 1 : -1 : 0; } ); }, embed : function( element ) { var parent = element.parent; // If the is child of a , copy the width // and height attributes from it. if ( parent && parent.name == 'object' ) { var parentWidth = parent.attributes.width, parentHeight = parent.attributes.height; parentWidth && ( element.attributes.width = parentWidth ); parentHeight && ( element.attributes.height = parentHeight ); } }, // Restore param elements into self-closing. param : function( param ) { param.children = []; param.isEmpty = true; return param; }, // Remove empty link but not empty anchor.(#3829) a : function( element ) { if ( !( element.children.length || element.attributes.name || element.attributes[ 'data-cke-saved-name' ] ) ) { return false; } }, // Remove dummy span in webkit. span: function( element ) { if ( element.attributes[ 'class' ] == 'Apple-style-span' ) delete element.name; }, // Empty in IE is reported with filler node ( ). pre : function( element ) { CKEDITOR.env.ie && trimFillers( element ); }, html : function( element ) { delete element.attributes.contenteditable; delete element.attributes[ 'class' ]; }, body : function( element ) { delete element.attributes.spellcheck; delete element.attributes.contenteditable; }, style : function( element ) { var child = element.children[ 0 ]; child && child.value && ( child.value = CKEDITOR.tools.trim( child.value )); if ( !element.attributes.type ) element.attributes.type = 'text/css'; }, title : function( element ) { var titleText = element.children[ 0 ]; titleText && ( titleText.value = element.attributes[ 'data-cke-title' ] || '' ); } }, attributes : { 'class' : function( value, element ) { // Remove all class names starting with "cke_". return CKEDITOR.tools.ltrim( value.replace( /(?:^|\s+)cke_[^\s]*/g, '' ) ) || false; } } }; if ( CKEDITOR.env.ie ) { // IE outputs style attribute in capital letters. We should convert // them back to lower case, while not hurting the values (#5930) defaultHtmlFilterRules.attributes.style = function( value, element ) { return value.replace( /(^|;)([^\:]+)/g, function( match ) { return match.toLowerCase(); }); }; } function protectReadOnly( element ) { var attrs = element.attributes; // We should flag that the element was locked by our code so // it'll be editable by the editor functions (#6046). if ( attrs.contenteditable != "false" ) attrs[ 'data-cke-editable' ] = attrs.contenteditable ? 'true' : 1; attrs.contenteditable = "false"; } function unprotectReadyOnly( element ) { var attrs = element.attributes; switch( attrs[ 'data-cke-editable' ] ) { case 'true': attrs.contenteditable = 'true'; break; case '1': delete attrs.contenteditable; break; } } // Disable form elements editing mode provided by some browers. (#5746) for ( i in { input : 1, textarea : 1 } ) { defaultDataFilterRules.elements[ i ] = protectReadOnly; defaultHtmlFilterRules.elements[ i ] = unprotectReadyOnly; } var protectElementRegex = /<(a|area|img|input)\b([^>]*)>/gi, protectAttributeRegex = /\b(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi; var protectElementsRegex = /(?:
in IE is reported with filler node ( ). pre : function( element ) { CKEDITOR.env.ie && trimFillers( element ); }, html : function( element ) { delete element.attributes.contenteditable; delete element.attributes[ 'class' ]; }, body : function( element ) { delete element.attributes.spellcheck; delete element.attributes.contenteditable; }, style : function( element ) { var child = element.children[ 0 ]; child && child.value && ( child.value = CKEDITOR.tools.trim( child.value )); if ( !element.attributes.type ) element.attributes.type = 'text/css'; }, title : function( element ) { var titleText = element.children[ 0 ]; titleText && ( titleText.value = element.attributes[ 'data-cke-title' ] || '' ); } }, attributes : { 'class' : function( value, element ) { // Remove all class names starting with "cke_". return CKEDITOR.tools.ltrim( value.replace( /(?:^|\s+)cke_[^\s]*/g, '' ) ) || false; } } }; if ( CKEDITOR.env.ie ) { // IE outputs style attribute in capital letters. We should convert // them back to lower case, while not hurting the values (#5930) defaultHtmlFilterRules.attributes.style = function( value, element ) { return value.replace( /(^|;)([^\:]+)/g, function( match ) { return match.toLowerCase(); }); }; } function protectReadOnly( element ) { var attrs = element.attributes; // We should flag that the element was locked by our code so // it'll be editable by the editor functions (#6046). if ( attrs.contenteditable != "false" ) attrs[ 'data-cke-editable' ] = attrs.contenteditable ? 'true' : 1; attrs.contenteditable = "false"; } function unprotectReadyOnly( element ) { var attrs = element.attributes; switch( attrs[ 'data-cke-editable' ] ) { case 'true': attrs.contenteditable = 'true'; break; case '1': delete attrs.contenteditable; break; } } // Disable form elements editing mode provided by some browers. (#5746) for ( i in { input : 1, textarea : 1 } ) { defaultDataFilterRules.elements[ i ] = protectReadOnly; defaultHtmlFilterRules.elements[ i ] = unprotectReadyOnly; } var protectElementRegex = /<(a|area|img|input)\b([^>]*)>/gi, protectAttributeRegex = /\b(on\w+|href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi; var protectElementsRegex = /(?: