GetSimple Support Forum

Full Version: Copy and paste formatting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Just stumbled on an issue that seems a bit weird. I can't seem to copy and paste the formatting of text in CKEDITOR.

I boldface, underline or create a link then just copy it and paste it underneath the formatted text. The formatting is lost completely and I'm just left with the plain text in <p></p> tags. All other formatting is lost.

I've looked at the config.js file and nothing in seems to mention why it's happening. I've even removed all the statements in that file to make sure - Same thing happens.

I've search google and it mostly mentions WORD to CKEDITOR losing formatting. Not CKEDITOR to CKEDITOR. The formatting is supposed to be pasted as well by default but on my installs it doesn't.

I believe it's with the COPY part as when I switch to "Source" after the copying the text is still plain when pasted.

Anybody having any idea on what is going on is much appreciated.
(2013-09-16, 13:38:09)stryker Wrote: [ -> ]I boldface, underline or create a link then just copy it and paste it underneath the formatted text. The formatting is lost completely and I'm just left with the plain text in <p></p> tags. All other formatting is lost.

If you use keyboard shortcuts Ctrl-C, Ctrl-X and Ctrl-V, then the formatting is lost.

To preserve formatting, you can still use the shortcuts Ctrl-C and Ctrl-X, but you must paste with the 'Paste from Word' CKEditor button.

You will have to use a custom setting for GSEDITORTOOL in gsconfig.php. This is what I have:
Code:
define('GSEDITORTOOL',"['Bold', 'Italic', 'Underline', 'NumberedList', 'BulletedList','JustifyLeft','JustifyCenter','JustifyRight',
'JustifyBlock', 'Table', 'TextColor', 'BGColor', 'Link','Unlink', 'Image', 'RemoveFormat', 'Source'],
['Cut','Copy','Paste','PasteFromWord','-','Undo','Redo','Find','Replace','-','SelectAll','-','Format']
");

There are other changes that I have made to the toolbar, but you can see the format, to save you having to look it up. ;-)

Edit to add: The instructions above will work to preserve formatting. There may be other methods, depending on which browser and OS you use. Similarly, there may be other ways to paste text without formatting, when this is desired. The CKEditor docs are not very clear.
Thanks for your help. I removed those icons trying to save space. After putting the "pasteFromWord" back I get a "Security" error but it works after that. Thanks again.