HTML Mangled

Posted by Community Admin on 04-Aug-2018 18:38

HTML Mangled

All Replies

Posted by Community Admin on 15-Apr-2016 00:00

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>

Posted by Community Admin on 15-Apr-2016 00:00

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.

Posted by Community Admin on 19-Apr-2016 00:00

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;

How to stop HtmlEditor's filters


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
 

Posted by Community Admin on 19-Apr-2016 00:00

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.

This thread is closed