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

XHTML formatting on IMG closing tag missing

1 Answer 65 Views
Editor
This is a migrated thread and some comments may be shown as answers.
NTS
Top achievements
Rank 1
NTS asked on 28 Jul 2016, 06:56 AM

Hi,

 

I see this happening.

Markup is shown properly in the HTML view of the RadEditor, but is stripped when rendered on the page.

Here is my HTML as shown in the RadEditor:

<p><img alt="the other" src="/PublishingImages/Signing-4730x.jpg" /></p

Note the end tags on IMG when the page is rendered I get this:
<p><img alt="the other" src="/PublishingImages/Signing-4730x.jpg"></p>

 

Also see this old post from 2009

Is this issue still applicable on the latest version of the RADEditor?

 

Ps. I know the <img> tag is a self closing tag, so the latter html is still valid. see here

 

Thanks!

Regards,

John

1 Answer, 1 is accepted

Sort by
0
Accepted
Ianko
Telerik team
answered on 02 Aug 2016, 06:29 AM

Hello John,

 

The results that you get in the HTML inspector of the browser is a result of the browser engine not RadEditor's. 

 

No matter how and where the img tags is inserted, void elements will be transformed to <[void] >, without the closing tag. You can see absolutely the same result here: https://jsbin.com/yaloyoxonu/edit?html,output

 

However, RadEditor's ConvertToXhtml filter handles the situation in order to preserve the XHTML compliance of the content (http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/managing-content/content-filters). Therefore, getting the HTML by using the RadEditor API will get you an XHTML compliant result.

 

I hope this clarifies the situation you have.

 

Regards,
Ianko
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Editor
Asked by
NTS
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or