I'm trying to implement FCKeditor and make its output XHTML 1.0 Strict compliant. I've disabled most of the features so it mostly is outputs simple stuff which is compliant.
However, I want to be able to align an image to the left or right and have it float. By default FCKeditor uses the align="left" attribute which is not compliant. If I could just get it to set class="left" instead then it would be completely compliant.
I've tried searching through the javascript for something to change but to be honest I'm not that good at javascript. I think it would be something fck_image.js that needs changing. Does anybody know how to do it?
However, I want to be able to align an image to the left or right and have it float. By default FCKeditor uses the align="left" attribute which is not compliant. If I could just get it to set class="left" instead then it would be completely compliant.
I've tried searching through the javascript for something to change but to be honest I'm not that good at javascript. I think it would be something fck_image.js that needs changing. Does anybody know how to do it?
Re: Swap align="left" for class="left"
In fck_image.js I made the following changes...
On line 133, I changed it to:
GetE('cmbAlign').value = GetAttribute( oImage, 'class', '' ) ;
On line 279 I changed it to:
SetAttribute( e, "class" , GetE('cmbAlign').value ) ;
And I commented out this so it doesn't reset the class attribute:
/*if ( oEditor.FCKBrowserInfo.IsIE )
{
e.className = GetE('txtAttClasses').value ;
e.style.cssText = GetE('txtAttStyle').value ;
}
else
{
SetAttribute( e, 'class' , GetE('txtAttClasses').value ) ;
SetAttribute( e, 'style', GetE('txtAttStyle').value ) ;
}*/
Which is line 291-300.
Commenting that out probably breaks something. I don't know. Hope this helps someone who needs a quick hack like I did.