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

HTML paragraph tag inserted when copy/paste from Notepad

2 Answers 24 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Zohaib
Top achievements
Rank 1
Zohaib asked on 23 Jul 2015, 08:56 AM

Hi,

I am copying text from notepad and pasting it in Editor in design mode and when i try to see it in HTML mode, a paragraph tag is inserted around the text.

Could you please advise me some solution for this issue?

Thank you‚Äč

2 Answers, 1 is accepted

Sort by
0
Zohaib
Top achievements
Rank 1
answered on 23 Jul 2015, 09:08 AM
Sorry I forgot to mention that this issue is only in IE.
0
Ianko
Telerik team
answered on 27 Jul 2015, 01:55 PM
Hello Zohaib,

The described behavior stems from IE. When plain text is pasted over, and there are lines separated by two carriage returns, instead of BR tags, paragraphs appear.

This can be bypassed and altered by using the OnClientPasteHtml event (http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/client-side-programming/events/onclientpastehtml), and make sure that always plain text is pasted. Plus, to make sure that paragraphs are transformed to BR tags, so to keep the carriage returns in the HTML content. You can also try to configure the StripFormattingOptions (http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/managing-content/pasting-content/overview#using-the-stripformattingoptions-property) and see whether you can achieve a satisfying output.

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
Zohaib
Top achievements
Rank 1
Answers by
Zohaib
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or