(accidentally posted this in Open Discussions forums...)
Is there a way to disable the "feature" where the FCKEditor re-writes or strips portions of HTML? For example, it seems to strip out any html, body or head tags it finds, and includes a tbody tag within tables. In our implementation, this is most definitely *not* what we want. In fact, I don't want the editor to touch the underlying HTML at all. I've searched the docs and the config file, but can see no easy way to disable that feature.
Any help is appreciated.
Is there a way to disable the "feature" where the FCKEditor re-writes or strips portions of HTML? For example, it seems to strip out any html, body or head tags it finds, and includes a tbody tag within tables. In our implementation, this is most definitely *not* what we want. In fact, I don't want the editor to touch the underlying HTML at all. I've searched the docs and the config file, but can see no easy way to disable that feature.
Any help is appreciated.
RE: Disable HTML validation/cleanup?
You can enable the full page edit just changing the configuration, one of the samples show how it works.
But given the fact that you are using a browser to edit the HTML, the browser itself will try to fix any HTML that it isn't valid, so it will automatically append <tbody>, add closing tags as needed etc...
The editor cares about normalization and fixing some browser bugs when serializing the content, but most of the editing and internal structure of the html is handled by the browser that will change invalid input into something that it can understand.
RE: Disable HTML validation/cleanup?
I just tried using full page edit mode, but that seems to automatically include the html, head, and body tags whether I want them or not...and in this case, I most definitely do *not* want them.
What I want is for no automatic HTML "cleanup" to happen by the editor, but it sounds like you're saying that the browsers themselves are what's "fixing" my content? I admit that I find that a little hard to believe, since I don't think I've seen that behavior in general (for example, if I build an HTML page without the tbody tag, then render it in a browser, then view source, I do not see a tbody tag added). I've tried FF and IE, and a couple of different doctypes to see if anything changed, but in every case, i got the same behavior.
In my specific case, the tbody tag is considered invalid html for emails. We are using this editor to compose those html emails, and as a result, we are getting invalid HTML for our purposes.
But, if you're really saying that this is not a function of FCKeditor, but instead is a function of the browser, and therefore is unchangeable, then I'll probably just strip out the tbody tags (and anything else that might be offensive) before I send the emails out.
Thanks again.
RE: Disable HTML validation/cleanup?
alert(document.body.innerHTML)
as that really represents the internal HTML that it is used by the browser and the code that will be returned to the editor.
RE: Disable HTML validation/cleanup?
RE: Disable HTML validation/cleanup?
RE: Disable HTML validation/cleanup?
not ideal, but it works..
$stripStuff = array (" ", "<tbody>");
$content=str_replace($stripStuff, "", $dbcontent);
echo $content;