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

Q3 2009 Editor Issue With Html Pasted In From Visual Studio .NET

2 Answers 30 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Robbe Morris
Top achievements
Rank 1
Robbe Morris asked on 10 Jul 2010, 04:44 PM
We use Telerik's editor for EggHeadCafe's forum post editor.  When members copy/paste html from Visual Studio .NET .aspx pages, the editor inserts a bunch of unnecessary line breaks and in some cases, inserts <p> tags in appropriate places breaking up the html.

For instance, if I paste this in from our about us page, it looks fine in the editor but the html retrieved from the control is all hosed up.  You can duplicate this in your editor samples for the Q3 2009 release.  Most members won't bother to create a code snippet out of this.  Are there settings I can use to improve the results?

 

<asp:Content ID="Content4" ContentPlaceHolderID="MiddleContent" Runat="Server">

 

 

<table border="0" cellpadding="0" cellspacing="0" width="1250">

 

 

<tr><td align="left" valign="top" ><img src="/images/Neado/MasterTopBackGround.png" border="0" alt=""/></td></tr>

 

 

<tr><td align="center" valign="top" style="background: #FFFFFF url(/images/neado/homepage02.gif) repeat-y center top;">

 

 

<br />

 

 

<

 

table border="0" width="1190" cellspacing="4" cellpadding="3" align="center">

 

 

<tr><td align="left" valign="top"><b>Welcome to EggHeadCafe.com!</b></td></tr>

 

<

 

tr><td align="left">EggHeadCafe was founded in 2000 by Microsoft Visual C# MVP's Peter Bromberg and Robbe Morris.&nbsp;&nbsp;This site is dedicated to providing you with information on the latest technologies.&nbsp;&nbsp;Everything from great C#, VB.NET, SQL Server, ADO.NET, ASP.NET, ASP, and JavaScript articles to product and book reviews are available to help you become the best software developer you can be.&nbsp;&nbsp;We've also got some of the best forums around to provide immediate answers to your tough questions.&nbsp; Our own subject matter experts will attempt to answer your question if our regular members don't get to you first.</td></tr>

 

 

<tr><td align="left">We do not take technical questions via email.&nbsp;&nbsp;If you have a business related question or a comment regarding your experience at EggHeadCafe, feel free to contact us at <a href="mailto:info@eggheadcafe.com?subject=EggHeadCafe%20Site%20Inquiry&cc=pbromberg@yahoo.com">info@eggheadcafe.com</a>.</td></tr>

 

 

 

 

<tr><td align="left">If you would like to ask a technical or programming question, please feel free to visit our <asp:HyperLink ID="HyperLink33333" runat="server" NavigateUrl="~/forum.aspx" Text="messageboard" />.</td></tr>

 

 

<tr><td><br /></td></tr>

 

<

 

tr><td align="left"><b>Subject Matter Experts Needed!</b></td></tr>

 

2 Answers, 1 is accepted

Sort by
0
Robbe Morris
Top achievements
Rank 1
answered on 10 Jul 2010, 04:44 PM
Looks like the settings in your own forum duplicate the behavior I described above.
0
Rumen
Telerik team
answered on 13 Jul 2010, 08:57 AM
Hi Robbe,

Let me provide you with details what is happening when pasting content from Visual Studio in RadEditor. The paste process is controlled entirely by the Operating System and by the browser. The editor is not allowed to interfere in this process much and it does not modify the content pasted from Visual Studio.

If you would like you can attach to the OnClientPasteHtml event, check for the Paste command execution and strip the empty <p> </p> paragraph tags with a regular expression.

The content pasted from VS is also not well formed which misleads the ConvertFontToSpan filter. That is why you could also enhance the appearance of the pasted from VS content by disabling the ConvertFontToSpan content filter of RadEditor. See this help article for more information: Content Filters.


Another approach is to instruct your users to use the Format Code Block tool of RadEditor to insert code snippets in RadEditor.

Best regards,
Rumen
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Editor
Asked by
Robbe Morris
Top achievements
Rank 1
Answers by
Robbe Morris
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or