+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / HTML Mangled

HTML Mangled

4 posts, 1 answered
  1. Jon Jones
    Jon Jones avatar
    19 posts
    Registered:
    13 Aug 2003
    15 Apr
    Link to this post

    Why is it that when I paste the HTML #1 below into a content block that the editor after saving changes it to HTML #2?  Notice it moves the <a> to under the <h2> and duplicates it above the <h2>, totally messing up the styling.  I don't want Sitefinity touching my HTML that was entered.  How can this be fixed?

    HTML #1

    <div class="row callouts__row">

      <div class="col-xs-12 col-sm-6 callout callout--s600">
        <a href="#0" class="callout__inner">
          <h2 class="callout__title callout__title--script">Text 1</h2>
        </a>
      </div>
      <div class="col-xs-12 col-sm-6 callout callout--events">
        <a href="#0" class="callout__inner">
          <h2 class="callout__title callout__title--script callout__title--dark">Text 2</h2>
        </a>
      </div>
    </div>

    HTML #2

    <div class="row callouts__row">
      <div class="col-xs-12 col-sm-6 callout callout--s600">
        <a href="#0" class="callout__inner">
        </a>
        <h2 class="callout__title callout__title--script"><a href="#0" class="callout__inner">Text 1</a></h2>
      </div>
      <div class="col-xs-12 col-sm-6 callout callout--events">
        <a href="#0" class="callout__inner">
        </a>
        <h2 class="callout__title callout__title--script callout__title--dark"><a href="#0" class="callout__inner">Text 2</a></h2>
      </div>
    </div>

  2. Jon Jones
    Jon Jones avatar
    19 posts
    Registered:
    13 Aug 2003
    15 Apr
    Link to this post
    Ok, I think I have discovered that the MVC Content Block editor is different than the standard content block editor.  The MVC one seems to leave your html alone so I'll use that for most things.  Although it doesn't have quite as many options and does not seem to allow you to disable containing divs.
  3. Dimitri Cools
    Dimitri Cools avatar
    80 posts
    Registered:
    08 Dec 2016
    19 Apr
    Link to this post
    Hi,

    This is managed by one of the filters of the HtmlEditor (Rad Editor), the ConvertToXhtml filter to be more specific.

    In order to only disable this filter and leave the rest in place you can navigate to 
    Administration -> Settings -> Advanced -> Appearance
    and find the following fields:

    Rad Editor's content filters
    RadEditor filters for Content block widget

    Then please enter the following filters in the above fields:

    RemoveScripts, EncodeScripts, StripCssExpressions, StripDomEventAttributes, FixUlBoldItalic, IECleanAnchors, FixEnclosingP, ConvertTags, ConvertFontToSpan, OptimizeSpans, IndentHTMLContent, ConvertCharactersToEntities, PdfExportFilter, ConvertInlineStylesToAttributes

    The above filters include all the default filters except the ConvertToXhtml.


    You can also turn them off completely, please observe the following KB-article;


    Also as a reference, you can re-write your own filter should you desire,
    more on the Custom Content Filters:
    http://demos.telerik.com/aspnet-ajax/editor/examples/contentfilters/defaultcs.aspx
    http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/managing-content/content-filters


    Regards,
    Dimitri Cools
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
    Answered
  4. Jon Jones
    Jon Jones avatar
    19 posts
    Registered:
    13 Aug 2003
    19 Apr in reply to Dimitri Cools
    Link to this post
    I think I tried turning all the filters off and that didn't seem to help.  I have switched to use the MVC content block and it's editor seems much cleaner so I'm not going to switch back right now.  Thanks.
4 posts, 1 answered