X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fstyles%2Fplugin.js;h=4d75b2d601ceb9344b41f59379942ec52e5e6263;hp=9a4f13d0948698c0a57ccfce2c733bb6b75ce3fc;hb=1056598c95187351dc58f4991d331e2258d038b5;hpb=4e90e78dc97789709ee7404359a5517540c27553 diff --git a/_source/plugins/styles/plugin.js b/_source/plugins/styles/plugin.js index 9a4f13d..4d75b2d 100644 --- a/_source/plugins/styles/plugin.js +++ b/_source/plugins/styles/plugin.js @@ -815,7 +815,7 @@ CKEDITOR.STYLE_OBJECT = 3; { var root = range.getCommonAncestor( true, true ), element = root.getAscendant( this.element, true ); - element && setupElement( element, this ); + element && !element.isReadOnly() && setupElement( element, this ); } function removeObjectStyle( range ) @@ -872,8 +872,11 @@ CKEDITOR.STYLE_OBJECT = 3; while ( ( block = iterator.getNextParagraph() ) ) // Only one = { - var newBlock = getElement( this, doc, block ); - replaceBlock( block, newBlock ); + if ( !block.isReadOnly() ) + { + var newBlock = getElement( this, doc, block ); + replaceBlock( block, newBlock ); + } } range.moveToBookmark( bookmark ); @@ -1446,6 +1449,16 @@ CKEDITOR.STYLE_OBJECT = 3; else styleText = unparsedCssText; + // Normalize font-family property, ignore quotes and being case insensitive. (#7322) + // http://www.w3.org/TR/css3-fonts/#font-family-the-font-family-property + styleText = styleText.replace( /(font-family:)(.*?)(?=;|$)/, function ( match, prop, val ) + { + var names = val.split( ',' ); + for ( var i = 0; i < names.length; i++ ) + names[ i ] = CKEDITOR.tools.trim( names[ i ].replace( /["']/g, '' ) ); + return prop + names.join( ',' ); + }); + // Shrinking white-spaces around colon and semi-colon (#4147). // Compensate tail semi-colon. return styleText.replace( /\s*([;:])\s*/, '$1' )