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

Self Closing Tags being modified

3 Answers 77 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Steve Harris
Top achievements
Rank 1
Steve Harris asked on 08 Nov 2014, 01:28 AM
I need to know if there is a setting that will stop the RadEditor from changing all the self closing tags /> to >

3 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 12 Nov 2014, 01:54 PM
Hello Steve,

I was unable to recreate the same scenario as in the description. No matter how tags are inserted in the Editor the self-closing ones stay always the same.

Please provide more details what are the steps leading to the encountered behavior. On a side note, provide more details about the configuration of the RadEditor and especially the enabled/disabled content filters.

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
John
Top achievements
Rank 1
answered on 18 Feb 2018, 09:16 PM

This is an old issue and sorry to awaken it but it is the exact problem I am having with the RadEditor.

When I enter the following into the html editor,it gets changed...

<telerik:RadMenuItem Text="Home" NavigateUrl="Default.aspx" />
<telerik:RadMenuItem IsSeparator="true" />
<telerik:RadMenuItem Text="Capability Overview" NavigateUrl="Capability.aspx" />
<telerik:RadMenuItem IsSeparator="true" />
<telerik:RadMenuItem Text="Contact Us" NavigateUrl="ContactUs.aspx" />

 

When I select Preview or Design and then back to HTML, the elements have been changed to the following;

<telerik:radmenuitem text="Home" navigateurl="Default.aspx">
<telerik:radmenuitem isseparator="true">
<telerik:radmenuitem text="Capability Overview" navigateurl="Capability.aspx">
<telerik:radmenuitem isseparator="true">
<telerik:radmenuitem text="Contact Us" navigateurl="ContactUs.aspx"></telerik:radmenuitem></telerik:radmenuitem></telerik:radmenuitem></telerik:radmenuitem></telerik:radmenuitem>

 

However, if I don't use the Self Closing tags, i.e. I stop using "/>" and switch to "></telerik:radmenuitem>" no changes are made. I'd prefer it if I could rely on the HTML I enter to remain as I enter it.

I have disabled all of the filters and still I am observing the behavior. Here is the code I use to disable the filters;

  this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertCharactersToEntities);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertFontToSpan);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertInlineStylesToAttributes);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertTags);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertToXhtml);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.EncodeScripts);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.FixUlBoldItalic);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.FixEnclosingP);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.IECleanAnchors);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.IndentHTMLContent);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.MozEmStrong);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.OptimizeSpans);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.PdfExportFilter);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.RemoveExtraBreaks);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.RemoveScripts);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.StripCssExpressions);
            this.radHtmlEditor.DisableFilter(Telerik.Web.UI.EditorFilters.StripDomEventAttributes);

Here is the RadEditor's declaration...

 <telerik:RadEditor EnableEmbeddedSkins="false"  RenderMode="Lightweight" runat="server" ID="radHtmlEditor"
                    
                    width="100%">
                    <ImageManager ViewPaths="~/Images/Uploads"
                    UploadPaths="~/Images/Uploads"
                    DeletePaths="~/Images/Uploads"
                    EnableAsyncUpload="true"></ImageManager>

            </telerik:RadEditor>

 

Any help would be appreciated.

Thank you...

 

 

0
Rumen
Telerik team
answered on 19 Feb 2018, 03:07 PM
Hi,

I tested the provided asp tags within an editable iframe (the sample is attached) and verified that the observed behavior is done by Chrome. You can reproduce the issue yourself with the provided example.

Regarding this even if you disable RadEditor filters you will get the same result.

That's why my advice is to close the tags and if needed you can self close them with String.Replace on the server once you get RadEditor content via the Content property.

Best regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular 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
Steve Harris
Top achievements
Rank 1
Answers by
Ianko
Telerik team
John
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or