Was this ever solved? We desperately want CKEditor to NOT replace instances of ampersands ('&') with & As previously noted, setting "entities : false" doesn't work (and causes other problems). Is there any way to get CKEditor to leave the ampersands alone?
alfonsoml wrote:Usually you don't need to change the entities configuration and instead just set forceSimpleAmpersand = true If you are talking about & in the contents, then those must be encoded or "bad things will happen"
There is no magic solution that will work for everyone.
If you want to use always & instead of & then you just have to do a replace() on the returned data. It's even safer in your case, data.replace("&&&", "&&&"), that's safe and you won't have problems. You don't require any special API, configuration or anything.
In general terms, the browser might be the one encoding &, or you can get unexpected dataloss if the user types > in design view and instead of it being saved as > it's saved as > (etc...) I know that in general people isn't interested in reading previous explanations about why some thing work the way they do, and it's funnier to blame just on CKEditor instead of putting an extra line of code in your part
Thanks for the reply. I'd love to try your suggestion, but it's unclear where or how I call data.replace. I've been combing the documentation for reference to a callback function to no avail. I tried using jquery to capture the setData event, but if I attempt to get the content (i.e..val() ) and replace all instances of & with &, then I end up in an infinite loop since setting the revised content triggers the setData event. Any help would be appreciated.
As a side note, I did discover if I set the following values in the configuration, the ampersands are left alone: basicEntities : false, entities : false, forceSimpleAmpersand : true, All three must be set this way for this to work Not sure what, if any, side effects there might be...
alfonsoml wrote:Usually you don't need to change the entities configuration and instead just set forceSimpleAmpersand = true If you are talking about & in the contents, then those must be encoded or "bad things will happen"
Re: Conversion of special characters
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
Re: Conversion of special characters
Basically I'm just wondering if there is any way to get the editor to leave all source code alone and not to modify it any way.
Re: Conversion of special characters
Re: Conversion of special characters
Re: Conversion of special characters
Re: Conversion of special characters
Re: Conversion of special characters
If you want to use always & instead of & then you just have to do a replace() on the returned data. It's even safer in your case, data.replace("&&&", "&&&"), that's safe and you won't have problems. You don't require any special API, configuration or anything.
In general terms, the browser might be the one encoding &, or you can get unexpected dataloss if the user types > in design view and instead of it being saved as > it's saved as > (etc...) I know that in general people isn't interested in reading previous explanations about why some thing work the way they do, and it's funnier to blame just on CKEditor instead of putting an extra line of code in your part
Re: Conversion of special characters
As a side note, I did discover if I set the following values in the configuration, the ampersands are left alone:
basicEntities : false,
entities : false,
forceSimpleAmpersand : true,
All three must be set this way for this to work Not sure what, if any, side effects there might be...
Re: Conversion of special characters
will