Opened 10 years ago

Closed 10 years ago

#10684 closed Bug (invalid)

Paste from Word leaves margin attribute

Reported by: santaclaus21 Owned by:
Priority: Normal Milestone:
Component: Core : Pasting Version:
Keywords: Cc:


So, I'm trying to use "Paste from Word" for copy html from web browser directly (leatest chrome).

I have used:

config.pasteFromWordRemoveFontStyles = true; config.pasteFromWordRemoveStyles = true;


first: sometimes in html source I can see font size (!) with long fraction and px - even if source had defined it in "em".

second: code contains margin definition (eg. "<p style="margin-left:10px;">[...]</p>")

conclusion: I need only to copy clear html code, with strong, underline etc. without ANY STYLES and CLASS. Paste from Word gives not exactly what I need, "Paste as plain text" also (no strong, italic and underline)..

Any help? :)

Change History (1)

comment:1 Changed 10 years ago by Jakub Ś

Resolution: invalid
Status: newclosed
Version: 4.2

This isn't bug in editor.

  1. If you want to disallow certain attributes permanently (not only on paste) use ACF:!/guide/dev_advanced_content_filter!/api/CKEDITOR.filter-method-addTransformations!/api/CKEDITOR.config-cfg-allowedContent!/api/CKEDITOR.config-cfg-extraAllowedContent

  1. If this is only about pasting HTML you could use paste event:
    CKEDITOR.replace( 'editor1', {
    	on: {
    		paste: function() { = ...;
     } );

You could use regex to filter and create new HTML. Property holds pasted HTML you can modify it assign new value to it.

  1. I wouldn't recommend changing pasteFromWord filter to get what you want.
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy