I seem to have a problem I can't seem to figure out. Sometimes when I paste text from an instance of the CKEditor into a different instance of the CKEditor, the pasted code includes styles that were not part of the original CKEditor's code.
For example, I made a quick link to an anchor in Editor 1:
When I copy it from the Visual view (not source) and paste it into Editor 2's Visual View, I get the following code:
Can anyone explain this behavior? I think that using the "Paste from Word" function may be a 'work around', but it seems strange that the CKEditor can't paste to and from itself without error.
For example, I made a quick link to an anchor in Editor 1:
<p><a href="#General" target="_blank">Test</a></p>
When I copy it from the Visual view (not source) and paste it into Editor 2's Visual View, I get the following code:
<p><a href="#General" style="border-style: initial; border-color: initial; font: inherit; " target="_blank">Test</a></p>
Can anyone explain this behavior? I think that using the "Paste from Word" function may be a 'work around', but it seems strange that the CKEditor can't paste to and from itself without error.
Re: Pasting from CKEditor to CKEditor pastes unwanted styles
Are you using Chrome or Safari by any chance?
Re: Pasting from CKEditor to CKEditor pastes unwanted styles
Yes, I am using Chrome. However, my client showed this to me, and they are using IE 8.
*UPDATE*
I tested this internally in IE9, IE8 mode, IE7 mode, Firefox, Chrome & Safari. Your assumption is correct. This does not occur in IE (contrary to what my client said) or Firefire. It does happen in Chrome and Safari. And boy, I thought Chrome was bad!
Re: Pasting from CKEditor to CKEditor pastes unwanted styles
Upon copy/paste, I get the following:
My class is completely lost, tons of garbage is added, and some styles covered by the class are even lost!
This issue is a NIGHTMARE for my clients, that have no knowledge of HTML/CSS and are borrowing elements from instances of the CKEditor for use on other pages. Is there a reason that the copy function within the CKEditor doesn't simply copy the code of the selected element???
Re: Pasting from CKEditor to CKEditor pastes unwanted styles
If you or your users don't like that behavior you should ask yourselves what good is a browser that doesn't behave like you want.
Re: Pasting from CKEditor to CKEditor pastes unwanted styles