HTML Mangled
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>
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.
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;
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.