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

Odd paragraph formatting from plain text

1 Answer 56 Views
Editor
This is a migrated thread and some comments may be shown as answers.
MakeMedia
Top achievements
Rank 1
MakeMedia asked on 30 Jul 2009, 03:56 PM

Hi there

 

We’re pretty new to RadEditor, however, we’re seeing some inconstancies when pasting plain text paragraphs into the editor.

 

Anyway, sometimes when I paste (ctrl v paste) three plain text paragraphs  the resulting HTML paras will be wrapped in <p> tags, some times there will be no <p> tags and the lines will be separated with <br /> tags and sometimes one paragraph will have <p>’s and another will not.

 

I’m assuming there is a setting I can configure to produce consistent results?!

 

Historically clients have a habit of messing up the formatting when using Rich Text editors so our advise is always ‘paste to plain text then paste to the editor’, hence the question.

 

Many thanks

 

Stephen


1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 31 Jul 2009, 12:18 PM
Hi Stephen,

RadEditor does not modify the pasted content by changing or replacing some tags for example replacing the <p> tags with <br> tags. RadEditor can be configured only to strip some special Word tags, attributes or formatting by setting the StripFormattingOnPaste property as it is demonstrated in this live demo: Cleaning Word Formatting.

If you would like to modify the pasted content manually using regular expressions or DOM code then you can attach to the editor's OnClientPasteHtml property event and get and modify the pasted content.
You can also modify the content with custom content filters, which are executing when switching between the editing modes or submitting the content.

Best regards
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
MakeMedia
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or