I am using FCK as a full webpage editor, and I have some webpages created by clients. Their code is not always clean (multiple <body> tags, etc.), and I am finding that when FCK attempts to "clean up" their code, it is getting rid of whole parts of their page. The thing is, they don't know until after their page is saved.
I would like to know if there is an option to prevent FCK from cleaning up and reformatting the existing content. I've been reading through the forums and Wiki for several days now and I have not found an answer. Any guidance would be greatly appreciated!
Thanks,
Brian
I would like to know if there is an option to prevent FCK from cleaning up and reformatting the existing content. I've been reading through the forums and Wiki for several days now and I have not found an answer. Any guidance would be greatly appreciated!
Thanks,
Brian
RE: How do I get FCK to NOT format existing HTML?
Thanks,
Brian
RE: How do I get FCK to NOT format existing H
It's not just that FCKeditor serializes the content and the can format the output, if the HTML that you provide is badly formed then the browser itself will change that code in order to understand and render it, and that it's done beyond the scope and control of FCKeditor.
This is an example of why it is important to validate the HTML of any page, if later on you want to do something new you can find yourself in big trouble because the new parser can't make any sense of the tag soup.
RE: How do I get FCK to NOT format existing H
The browser dont change the code, if it can't understand it, it wont be visible at all, worst case.
It will not "move around" the tags and if it can get something good from the bad html.
RE: How do I get FCK to NOT format existing H
Just try to save this code as an .htm file and open it in your browser of choice. Does the alert show exactly the same code that it's present inside the outermost body?
No:
the inner body it's removed
the missing <tbody> and </tbody> are added
the missing </tr> it's added
in IE quotes are removed from the attributes.
Code:
If all those changes are done in just so little code, imagine all the things that can be changed in a big file with lots of problems.
RE: How do I get FCK to NOT format existing H
Perhaps I should only allow FCKeditor to open files that were created with FCKeditor.
Brian
RE: How do I get FCK to NOT format existing H
FCK editor is using browser's visualisation engine to display Rich Text Content, which relays on DOM. It's not FCK messing with your content, it's browser.
Anyway, you can use CDATA tags to make your code untouchable to the browser, but it won't be visible either.
try this:
<code>
invisible lions live behind this line<hr /> <!--[CDATA[
<h5>bar</h3>
]]-->
</code>
(in case SF escape the tags:)
<code>
invisible lions live behind this line <hr /> <!--[CDATA[
<h5>bar</h3>
]]-->
</code>
RE: How do I get FCK to NOT format existing H
I decided to have FCKeditor initialize only if the HTML file was originally created in FCK.
Thanks for everyone's help.
Brian
RE: How do I get FCK to NOT format existing H
I am looking for the program to do the exact same thing you were hoping for - to leave pasted html code untouched - can you explain how you accomplished this?
Best Regards,
Mike
RE: How do I get FCK to NOT format existing H
You're right, I was thinking of the code thats visible in the browser, view source.
Its not affected at all, its "behind the curtain" browsers change the code.
If you add a misspelled tag, or an invalid tag (fx <lorem="ipsum">) its not deleted from the view source, but its not renderd, because it may be understood by an editor, or maybe a another browser.
Johnny