I am using FCKEditor for an email web application and when I load the editor with the (HTML) contents of certain email files (.eml file), the editor briefly shows the contents then clears itself.
This only occurs in Firefox; in IE7 it works fine.
I'm using ASP.Net with C# code behind and when I debug on the server, I see the HTML contents of the editor.
And when I view the source on the page, I see the contents of the email are being sent correctly.
It's just when it comes to display the email in the FCKEditor control on the page that it briefly shows it then disappears (in Firefox only).
I suspect it is to do with the output from Outlook with MS Office styling that creates "invalid" HTML but am not sure.
I cannot pinpoint which emails it can display and which it can't but was wondering if anyone else had come across this problem before.
Does FCKEditor give up when it is populated with "invalid" HTML?
If so, is there any way to switch off this validation as I really need to display the contents of the email - whether it is valid or not?
Any help or comments would be greatly appreciated as it's affecting my Firefox users.
This only occurs in Firefox; in IE7 it works fine.
I'm using ASP.Net with C# code behind and when I debug on the server, I see the HTML contents of the editor.
And when I view the source on the page, I see the contents of the email are being sent correctly.
It's just when it comes to display the email in the FCKEditor control on the page that it briefly shows it then disappears (in Firefox only).
I suspect it is to do with the output from Outlook with MS Office styling that creates "invalid" HTML but am not sure.
I cannot pinpoint which emails it can display and which it can't but was wondering if anyone else had come across this problem before.
Does FCKEditor give up when it is populated with "invalid" HTML?
If so, is there any way to switch off this validation as I really need to display the contents of the email - whether it is valid or not?
Any help or comments would be greatly appreciated as it's affecting my Firefox users.
Re: FCKEditor goes blank in Firefox!
Re: FCKEditor goes blank in Firefox!
Nothing in the Error Console that would give any clues I'm afraid.
It's really annoying the rubbish that is generated by Office when creating an email.
There's not a lot I can do really, I have to show the email and can only use the .eml file I have as the source for my text editor.
Here is an example of what I am seeing in the FCKEditor:
Re: FCKEditor goes blank in Firefox!
Try enabling full-page mode:
http://docs.fckeditor.net/FCKeditor_2.x ... s/FullPage
Not saying that you would need to edit it in this mode, but at least you would know if that's the problem. If it is and you need to edit HTML in non-page mode, you may need to find some program to tidy it up. Something like that:
http://www.w3.org/People/Raggett/tidy/
Re: FCKEditor goes blank in Firefox!
The problem is not yet solved but I can see what is causing the issue now.
Enabling full-page mode allowed me to click on the Source button to see what had made it into the editor on the client.
Previously, when not in full-page mode, the Source was blank which made it very difficult to know what was happening.
This "full" view was actually a truncated view of the entire HTML that should have been there.
On closer examination, it would appear that the various email systems have simply concatenated <html><body>....</body></html> along the way to create footer information (eg this message has been virus checked by ....).
Every time someone replied to a message, extra footer information would simply be tagged at the end of the message, creating a document that had multiple <html> and <body> elements.
So the HTML was in fact wrong with multiple <html> sections in it.
FCKEditor had merely done its best and ignored the extra sections.
Unfortunately, the extra sections were the ones that contained the actual email text and these were not being rendered in Firefox.
The fact that it works in IE is amazing; Firefox is less forgiving and stripped away the extra sections.
So the issue is all those email systems out there that cannot create valid HTML and nothing to do with FCKEditor!!!
Now all I have to do is work out how to strip out the extra sections that I'm not interested in.
That's not so easy because it would mean locating the extra <html><body>...</body></html>, converting them to <divs> and placing them just before the real </body></html>
Re: FCKEditor goes blank in Firefox!
I can load the email with multiple <html>...</html> sections into Firefox and it renders "correctly"; ie it handles the multiple <html> sections.
When I view the generated source, I see that (internally) it has altered the HTML and moved the 2nd <html> section inside the <html>....</html> to create "valid" HTML.
So Firefox is forgiving just like IE is and renders "invalid" HTML.
Whether this is a good thing or not....?
I can only deduce that the IE version of the FCKEditor must differ to the Gecko version and handle "invalid" markup differently.
Can anyone from the development team verify this?
Re: FCKEditor goes blank in Firefox!
It seems your "fix data and load" solution" is the correct approach to it.
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Re: FCKEditor goes blank in Firefox!
I can see that in the generated source code on the page.
Also, I can tell you that the invalid HTML displays correctly when viewed as the body of an iFrame.
The problem definitely occurs when (in my application) I click on the Reply button to reply to the email.
It's the point when the editor is loaded that something goes awry.
To test this, I simply copied the entire invalid HTML (the bit containing two <html> sections), moved to source mode and pasted it into the editor.
In source mode, it goes in fine and I see both <html> sections.
But when I move to html mode then back to source mode, FCKEditor is not handling it correctly.
OK. Try this in a completely blank FCKEditor using Firefox browser.
Go to Source mode and enter the following:
Now go back to HTML mode and you'll see that the editor goes blank.
When you now move back to Source mode, you've lost the code you entered above!!!
Surely, something is wrong here???
Re: FCKEditor goes blank in Firefox!
Andre
Re: FCKEditor goes blank in Firefox!
[A.M.] I am using the (excellent) Chilkat Email .Net component to retrieve the email from the POP3 server (http://www.chilkatsoft.com/refdoc/csEmailRef.html)
I then use the Email.GetHtmlBody() method of this Email component to retrieve the HTML content of the email.
Yes, I believe the eml file retrieved from the POP3 server is simply a RFC 822 MIME text file.
Is that a known problem?
Re: FCKEditor goes blank in Firefox!
What I'm getting at is that you seem to be getting more than one part of a multipart MIME message, which would explain multiple <html> tags (e.g. if you attach a message to another message, each could contain <html>). Multiple replies in a single message, on the other hand, are not supposed to be wrapped into multiple <html> tags. I checked Outlook Express and Outlook and it seems that each produces poorly-formatted, but otherwise usable HTML, without stacking HTML docs or wrapping one in another.
Andre
Re: FCKEditor goes blank in Firefox!
I can clearly see that the message in question is a multipart MIME message as you suggest.
The first part has content-type: text/plain; the second part has content-type: text/html
The Chilkat Email component allows me to get either part via calls to Email.GetPlainTextBody() or to Email.GetHtmlBody()
In the second part of the .eml file, I can clearly see that (even within the single message) there are two <html> docs.
I think the actual fault here might lie in the outgoing server that appends the standard "This message is intended only for the use of the addressee and may contain information...." type footer to the end of each and every outgoing email message.
This footer text is being wrapped in <html>...</html> when clearly it should be just a <div>...</div> or other such construct.
However, with that being said, there is still the issue with how FCKEditor is handling such invalid HTML.
I'm not for a minute saying that FCKEditor is at fault here - just that it doesn't handle the situation very gracefully.
And in the example I gave above with two very simple <html> sections, if you move to HTML mode and back to Source mode, it loses the original document!!
Maybe in this instance I just need to strip out the second <html> section - even though I am going to lose some of the email message???
But the fact is that even with multiple HTML sections in a single document, both IE and Firefox render this correctly in a simple browser window.
So it is the way FCKEditor is handling this that is not right, specifically the Gecko implementation as it works fine in IE!!
Is there a way of telling FCKEditor to not even try to validate the HTML and just take it as it is?
By the way, thanks A.M. for your input - it is much appreciated.
Re: FCKEditor goes blank in Firefox!
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn