Log in or register to post comments
Last post
deshg's picture
Joined: 06/04/2011
Posts: 4
CKEditor adding " to styles and links
Hey everyone,

I have just added ckeditor to a site i'm building and it nearly all works fine. The problem is when I add a link using the link button on the toolbar or add one of my custom style definitions from the pull down box (which creates a span with an associated class) it seems to add them okay initially, when i view source they look like the following:

<span class="title">Title text</span>
<a href="http://www.test.com">Link text</a>

However once i click Save these change to :

<span class="\&quot;title\&quot;">Title text</span>
<a href="\&quot;http://www.test.com\&quot;">Link text</a>

And each time i click save it adds another \&quot; either side of the href/class definition (almost as if it's replacing the quotes but failing to delete them afterwards). I've implemented ckeditor a number of times and never had this problem before and would be immensely grateful if anyone knows why this might be? I tried upgrading to the lastest version (the only thing i changed was the config.js, contents.css and styles.js files) but I have the same problem, except the href field in links now changes to "\" every time no matter what is entered (and i have the same &quot problem with the class definitions).

Thanks so much for any light anyone can shed on this as I can't work out why it's doing it!

tony_c's picture
Joined: 15/11/2011
Posts: 10
Re: CKEditor adding &amp;quot; to styles and links
Does anyone know why this would happen? I've used CKEditor in my CMS system and never had this happen before. Just installed the CMS in a new website and this has happened. What could cause it?

EDIT: I dumped the POST data and saw that all the quotation marks had a backslash in front of them, which would explain the behaviour. That still doesn't explain why the backslash is being put there in the first place though. I'm not doing anything to the input at all before submission, so why would CKEditor add a backslash?