This is a migrated thread and some comments may be shown as answers.

Clean formatting on paste

4 Answers 337 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Zen
Top achievements
Rank 1
Zen asked on 18 Nov 2015, 11:50 AM

 Is there a way to clean formatting when pasting the content of the clipboard (not from MS Word document) into the Kendo UI Reader?

Basically, I want to accomplish the same thing as the clean formatting tool does.  

 

Thanks!

Zen

4 Answers, 1 is accepted

Sort by
0
Zen
Top achievements
Rank 1
answered on 18 Nov 2015, 02:31 PM

I mean to say Kendo UI Editor. So the question should be:

Is there a way to do clean formatting when pasting the content of the clipboard (not from MS Word document) into the Kendo UI Editor? 

Basically, I want to accomplish the same thing as the clean formatting tool does.  

 

Thanks!

 

Zen

0
Dimo
Telerik team
answered on 20 Nov 2015, 02:46 PM
Hi Zen,

Customizations on the pasted content can be performed in the paste event of the Editor.

http://docs.telerik.com/kendo-ui/api/javascript/ui/editor#events-paste

You can either use string manipulation, or temporarily inject the pasted content in an invisible container and clean the formatting via DOM manipulation.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Zen
Top achievements
Rank 1
answered on 23 Nov 2015, 03:09 PM

Dimo, thank you very much for your prompt reply. 

 Is there a way though, to use the code behind the Clean Formatting tool, to clean the pasted content?

 

Thanks!

Zen

0
Dimo
Telerik team
answered on 24 Nov 2015, 02:05 PM
Hello Zen,

The "Clean formatting" tool works with the currently selected content in the Editor. From this point of view, the tool can be used for the pasted content only if the user selects what he have already pasted and clean it manually.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Editor
Asked by
Zen
Top achievements
Rank 1
Answers by
Zen
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or