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

Image tag border attribute is deleted by editor

2 Answers 106 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Laurie
Top achievements
Rank 1
Laurie asked on 21 Nov 2016, 11:33 PM
When inserting an image via the Image Manager, the css for the height, width, border attributes that are chosen is properly generated.  However, for better compatibility with some email rendering clients, I also need to have these attributes exist as html image tag attributes (for example:  <img width="100" height="100" border="2" .)  When I manually add these attributes to the image tag, I find that the editor deletes the border attribute.  How can I prevent this deletion from occurring?  I have uploaded examples to show what I manually add and what the editor keeps/deletes.  Thank you.

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 22 Nov 2016, 09:30 AM

Hi Laurie,

You can disable the ConvertToXhtml filter because the border attribute is not valid XHTML:

RadEditor1.DisableFilter(EditorFilters.ConvertToXhtml);

Creating valid XHTML content is of vital importance for RadEditor and as such it is its first priority.

Regards,

Marin Bratanov
Telerik by Progress
Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
0
Laurie
Top achievements
Rank 1
answered on 22 Nov 2016, 06:57 PM
Thank you so much.  Your reply is very helpful!  I had forgotten about image border attribute and XHTML.  As we will prefer to leave the filter in place, I can work around by placing images into tables, then style the tables.  
Tags
Editor
Asked by
Laurie
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Laurie
Top achievements
Rank 1
Share this question
or