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

New Line Behavior When Pasting

1 Answer 104 Views
Editor
This is a migrated thread and some comments may be shown as answers.
J. David
Top achievements
Rank 1
J. David asked on 01 Jun 2015, 02:31 PM

We currently have implemented RadEditor with the default paragraph tag new line mode.  It is working correctly - when someone hits the Enter key in the editor, it encapsulates the content within paragraph tags.

However, when we paste content in from the clipboard, RadEditor is generating a <br/> tag for each new line.

We would like the Editor to have the same paragraph tag new line behavior when pasting.  Is there an easy way to do this, or is writing a custom filter the only way to handle it?

 

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 04 Jun 2015, 05:02 AM
Hi,

The NewLineBehavior only instructs what to happen when Enter is hit. Whereas, pasting content, cannot be modified by this functionality. No matter, what option is chosen, P, BR and DIV are always considered as new lines, but a replacement of one tag to another is not a job of the new line behavior.

As pasting should always lead to an output that is the same as the source from where text is copied, there is no automatic built-in functionality for that. Indeed, the only option is to create a custom content filter (http://demos.telerik.com/aspnet-ajax/editor/examples/contentfilters/defaultcs.aspx), that achieves the required results.

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Editor
Asked by
J. David
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or