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

Radeditor HTML formatting issue

2 Answers 178 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Brijesh
Top achievements
Rank 1
Brijesh asked on 16 May 2017, 12:12 PM
Hello support team,

Heading : I am having issue with radeditor HTML formatting

Background : I am using radeditor in my aspx page, My application is reading emails from third party and then after I am displaying those emails body in my page radeditor control. As we are fetching email from third party so we don't have any control over HTML which they are sending.

Issue : Partial HTML is not displaying properly in my radeditor control

I walk through radeditor demo application postedby telerik http://demos.telerik.com/aspnet-ajax/editor/examples/builtinmodules/defaultcs.aspx and I found that it is working smooth in the demo given by you

So I create a demo application to reproduce the issue which I am facing and attached as screenshot in my post (Not able to upload zip folder though). So kindly go through it and let me know if I am missing any property that allow such thing or anything which is restrict my application to do so

P.S : I am using telerik version 2016.2.607.40

Let me know if you need any additional information

Thanks
 - Brijesh

2 Answers, 1 is accepted

Sort by
0
Brijesh
Top achievements
Rank 1
answered on 18 May 2017, 11:31 AM

Hello Support team,

This is urgent, Can you please look into this ASAP?

This is happening on my Production application

Thanks

- Brijesh

0
Rumen
Telerik team
answered on 19 May 2017, 08:38 AM
Hi Brijesh,

I am afraid that RadEditor cannot handle invalid HTML content with multiple <html> tags. By default the browser automatically strips the HTML, HEAD and BODY tags and the functionality that preserves the HTML, HEAD and BODY tags is internal to RadEditor. The content that you load is breaking it and only part of the content is loaded.


What you can do is to strip the HTML, HEAD and BODY tags and load only the content inside them in RadEditor. After that once you export the content you can add them again:

string newContent = "<html><head></head><body> " + RadEditor1.Content + "</body></html>";


Best regards,
Rumen
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Editor
Asked by
Brijesh
Top achievements
Rank 1
Answers by
Brijesh
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or