Is there a way to disable html code correction? Over and over and over again the editor undoes my work because it thinks it is correcting errors in my code. For example, this little piece of code gets changed every single time:

<a href="mylink.html"><center><img src="myimage.jpg" /></center></a>

is changed to

<center><a href="mylink.html"><img src="myimage.jpg" /></a></center>

I realize center is not the way to do things anymore, the template has some CSS that prevents this working properly using the latter. There is ZERO reason for fckeditor to change this code around and zero reason I should have to manually change this every #*$#$()@# time I edit that particular piece of content. This is one of about a thousand examples I run into every week where fckeditor/ckeditor prevents perfectly normal valid code from working properly.

Most commonly the problem arises under more unusual circumstances, but the end result is html code correction just doesn't work and causes migraine after migraine after migraine. How do I turn it off?

EDIT: added code tags - dman.

Comments

jorrit’s picture

Status: Active » Closed (fixed)

It can be caused by two things:

* A configuration variable in FCKeditor. For this, please check http://docs.cksource.com/FCKeditor_2.x/Developers_Guide
* A filter in Drupal. Check your Filter settings at admin/settings/filters

The FCKeditor module certainly doesn't alter your content, so you should look somewhere else.

dman’s picture

FWIW, I tried pasting that code into my fckediitor 'plain text editor' field and on preview, and also on save+re-edit it remained intact and the same as was input.
Not sure if you've got another filter that is 'fixing' it for you, but fck alone + full html input format doesn't seem to damage it. At least with the versions I've got.

It is however bad and invalidating code, as flow-level elements (a tag) really are prohibited from enclosing block-level elements : center tag. Even in old HTML where you were allowed to use 'center' - that is bad HTML. So something, somewhere is trying to protect you from your own mistakes. Although it seems pretty clear what you are trying to do, support for what you are doing would be patchy in browsers. No need to get so indignant when your input really is actually invalid.