Self Closing Tags being modified

4 posts, 0 answers
  1. Steve Harris
    Steve Harris avatar
    1 posts
    Member since:
    Mar 2005

    Posted 07 Nov 2014 Link to this post

    I need to know if there is a setting that will stop the RadEditor from changing all the self closing tags /> to >
  2. Ianko
    Admin
    Ianko avatar
    1914 posts

    Posted 12 Nov 2014 Link to this post

    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.

     
  3. John
    John avatar
    6 posts
    Member since:
    Jul 2015

    Posted 18 Feb 2018 in reply to Ianko Link to this post

    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...

     

     

  4. Rumen
    Admin
    Rumen avatar
    14219 posts

    Posted 19 Feb 2018 Link to this post

    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.
Back to Top