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

Rad Editor - Anchor tag issue

1 Answer 95 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Pranav
Top achievements
Rank 1
Pranav asked on 13 Jul 2016, 06:17 AM

In body of Rad editor if i pasted the code below in HTML container -

<a href="http://members.farmtoconsumer.org/donations/" target="_blank">
<figure class="center-img">
<img style="border: 0px solid currentColor; border-image: none; width: 100%; max-width: 303px !important;" alt="Donate Today!" src="https://media.mercola.com/assets/images/donate-today.jpg">
<figcaption class="op-large op-center hide-figcap">
<a href="http://members.farmtoconsumer.org/donations/" target="_blank">Click Here</a>
</figcaption>
</figure>
</a>

After this when i switch from HTML to design and then again back to HTML the code changes to below code -

<a href="http://members.farmtoconsumer.org/donations/" target="_blank">
</a><figure class="center-img"><a href="http://members.farmtoconsumer.org/donations/" target="_blank">
<img style="border: 0px solid currentColor; border-image: none; width: 100%; max-width: 303px !important;" alt="Donate Today!" src="https://media.mercola.com/assets/images/donate-today.jpg">
</a><figcaption class="op-large op-center hide-figcap"><a href="http://members.farmtoconsumer.org/donations/" target="_blank">
</a><a href="http://members.farmtoconsumer.org/donations/" target="_blank">Click Here</a>
</figcaption>
</figure>

Notice that the <a> tag was immediately closed. It seems like the editor updates the codes accordingly (some sort of auto-correcting html codes I guess). Is there any way we can avoid this or is this something that we cannot modify or any solution for this?

1 Answer, 1 is accepted

Sort by
0
Misho
Telerik team
answered on 15 Jul 2016, 08:34 AM
Hello,

This is the browsers' behavior that are modifying the HTML in this manner. This could be observed also on a page with simple editable div:
http://dojo.telerik.com/@parvanov/enAZO
Here is a video showing the result of the test:
http://screencast.com/t/opxR4Wn9x

Best Regards,
Misho
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
Pranav
Top achievements
Rank 1
Answers by
Misho
Telerik team
Share this question
or