Index: /FCKeditor/trunk/editor/_source/classes/fckstyle.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fckstyle.js	(revision 926)
+++ /FCKeditor/trunk/editor/_source/classes/fckstyle.js	(revision 927)
@@ -183,14 +183,14 @@
 				if ( this.CheckElementRemovable( pathElement ) )
 				{
-					if ( isBoundary 
-						&& !FCKDomTools.CheckIsEmptyElement( pathElement, 
-								function( el ) 
-								{ 
-									return ( el != bookmarkStart ) ; 
-								} ) 
+					if ( isBoundary
+						&& !FCKDomTools.CheckIsEmptyElement( pathElement,
+								function( el )
+								{
+									return ( el != bookmarkStart ) ;
+								} )
 						)
 					{
 						lastBoundaryElement = pathElement ;
-						
+
 						// We'll be continuously including elements in the
 						// boundaryElements array, but only those added before
@@ -211,8 +211,18 @@
 								if ( FCKDomTools.HasAttribute( pathElement, att ) )
 								{
-									if ( att == 'style' )
-										this._RemoveStylesFromElement( pathElement ) ;
-									else
-										FCKDomTools.RemoveAttribute( pathElement, att ) ;
+									switch ( att )
+									{
+										case 'style' :
+											this._RemoveStylesFromElement( pathElement ) ;
+											break ;
+
+										case 'class' :
+											// The 'class' element value must match (#1318).
+											if ( FCKDomTools.GetAttributeValue( pathElement, att ) != this.GetFinalAttributeValue( att ) )
+												continue ;
+
+										default :
+											FCKDomTools.RemoveAttribute( pathElement, att ) ;
+									}
 								}
 							}
@@ -349,8 +359,18 @@
 						if ( FCKDomTools.HasAttribute( currentNode, att ) )
 						{
-							if ( att == 'style' )
-								this._RemoveStylesFromElement( currentNode ) ;
-							else
-								FCKDomTools.RemoveAttribute( currentNode, att ) ;
+							switch ( att )
+							{
+								case 'style' :
+									this._RemoveStylesFromElement( currentNode ) ;
+									break ;
+
+								case 'class' :
+									// The 'class' element value must match (#1318).
+									if ( FCKDomTools.GetAttributeValue( currentNode, att ) != this.GetFinalAttributeValue( att ) )
+										continue ;
+
+								default :
+									FCKDomTools.RemoveAttribute( currentNode, att ) ;
+							}
 						}
 					}
@@ -509,8 +529,18 @@
 				if ( FCKDomTools.HasAttribute( innerElement, att ) )
 				{
-					if ( att == 'style' )
-						this._RemoveStylesFromElement( innerElement ) ;
-					else
-						FCKDomTools.RemoveAttribute( innerElement, att ) ;
+					switch ( att )
+					{
+						case 'style' :
+							this._RemoveStylesFromElement( innerElement ) ;
+							break ;
+
+						case 'class' :
+							// The 'class' element value must match (#1318).
+							if ( FCKDomTools.GetAttributeValue( innerElement, att ) != this.GetFinalAttributeValue( att ) )
+								continue ;
+
+						default :
+							FCKDomTools.RemoveAttribute( innerElement, att ) ;
+					}
 				}
 			}
