We have been using FCK editor for years with a custom CMS and have been happy, but finally are biting the bullet and upgrading so that we have better browser compatibility, etc. (Chrome and IE without compatibility mode.)
A major problem we are having is editing older documents that were created with FCK and have invalid HTML.
We've been working with our editors and trying to fix the HTML using regex before it's put into the editor, but I'm beginning to feel that we are chasing a never ending list of issues.
So, I'm hoping to disable some of the corrections done when opening old articles. I'm sure it would be better to fix the HTML going in, but like I said, it's difficult using simple regex, and too difficult for our editors.
I've tried a couple things, like messing with CKEDITOR.dtd in config.js:
And, I've tried going very drastic with things like:
The first seem a little bit risky, and the second very risky.
What I'd really like to do is somehow control the way the htmlDataProcessor goes about fixing the errors it encounters, so that it would do what I am trying to do with the regular expressions. Is there any way to alter the way the processor fixes errors?
Alternatively, I was curious if anyone has every put together a more lenient CKEDITOR.dtd to help with the transition from FCK, which I could swap out.
If none of this seems like a good idea, I am open to other suggestions. (I'm trying to avoid cleaning it all up before passing it to the editor if at all possible.)
If the only solution is to try to clean it before hand, is there a way to know if htmlDataProcessor does any structural alterations so that I know when I've missed something and can display a warning so the editor knows to verify the document?
A major problem we are having is editing older documents that were created with FCK and have invalid HTML.
We've been working with our editors and trying to fix the HTML using regex before it's put into the editor, but I'm beginning to feel that we are chasing a never ending list of issues.
So, I'm hoping to disable some of the corrections done when opening old articles. I'm sure it would be better to fix the HTML going in, but like I said, it's difficult using simple regex, and too difficult for our editors.
I've tried a couple things, like messing with CKEDITOR.dtd in config.js:
CKEDITOR.dtd.h1.div = 1; CKEDITOR.dtd.h2.div = 1; CKEDITOR.dtd.h3.div = 1; CKEDITOR.dtd.h4.div = 1;
And, I've tried going very drastic with things like:
CKEDITOR.htmlDataProcessor.prototype.toHtml = function( data, fixForBody ) { return data; } CKEDITOR.htmlDataProcessor.prototype.toDataFormat = function( data, fixForBody ) { return data; }
The first seem a little bit risky, and the second very risky.
What I'd really like to do is somehow control the way the htmlDataProcessor goes about fixing the errors it encounters, so that it would do what I am trying to do with the regular expressions. Is there any way to alter the way the processor fixes errors?
Alternatively, I was curious if anyone has every put together a more lenient CKEDITOR.dtd to help with the transition from FCK, which I could swap out.
If none of this seems like a good idea, I am open to other suggestions. (I'm trying to avoid cleaning it all up before passing it to the editor if at all possible.)
If the only solution is to try to clean it before hand, is there a way to know if htmlDataProcessor does any structural alterations so that I know when I've missed something and can display a warning so the editor knows to verify the document?