Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html (revision 5008)
+++ /CKEditor/trunk/CHANGES.html (revision 5009)
@@ -71,4 +71,5 @@
#4683 : Double-quote character in attribute values is not escaped in editor output.
#4762 : [IE] Unexpected vertical-scrolling behavior happens whenever focus is moving out of editor in source mode.
+ #4772 : Fore-color style must be applied within a link instead of wrapping it.
Updated the following language files:
- #5006 : Dutch;
Index: /CKEditor/trunk/_source/plugins/colorbutton/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/colorbutton/plugin.js (revision 5008)
+++ /CKEditor/trunk/_source/plugins/colorbutton/plugin.js (revision 5009)
@@ -195,5 +195,11 @@
element : 'span',
styles : { 'color' : '#(color)' },
- overrides : [ { element : 'font', attributes : { 'color' : null } } ]
+ overrides : [ { element : 'font', attributes : { 'color' : null } } ],
+
+ // Fore color style must be applied inside links instead of around it.
+ childRule : function( element )
+ {
+ return element.getName() != 'a';
+ }
};
Index: /CKEditor/trunk/_source/plugins/styles/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/styles/plugin.js (revision 5008)
+++ /CKEditor/trunk/_source/plugins/styles/plugin.js (revision 5009)
@@ -376,5 +376,7 @@
// Check if the current node can be a child of the style element.
- if ( !nodeName || ( dtd[ nodeName ] && ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED ) ) )
+ if ( !nodeName || ( dtd[ nodeName ]
+ && ( currentNode.getPosition( lastNode ) | CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED )
+ && ( !def.childRule || def.childRule( currentNode ) ) ) )
{
var currentParent = currentNode.getParent();
@@ -382,5 +384,7 @@
// Check if the style element can be a child of the current
// node parent or if the element is not defined in the DTD.
- if ( currentParent && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement ) )
+ if ( currentParent
+ && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement )
+ && ( !def.parentRule || def.parentRule( currentParent ) ) )
{
// This node will be part of our range, so if it has not
@@ -407,5 +411,6 @@
while ( !includedNode.$.nextSibling
&& ( parentNode = includedNode.getParent(), dtd[ parentNode.getName() ] )
- && ( parentNode.getPosition( firstNode ) | CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_FOLLOWING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED ) )
+ && ( parentNode.getPosition( firstNode ) | CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_FOLLOWING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED )
+ && ( !def.childRule || def.childRule( parentNode ) ) )
{
includedNode = parentNode;