Sitefinity doesn't like arbitrary html elements

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

Sitefinity doesn't like arbitrary html elements

All Replies

Posted by Community Admin on 18-Oct-2012 00:00

I tried adding a <section> tag (and other tags) in a content editor, and Sitefinity rearranges the content horribly:

input:
<section>
<h1>Hello</h1>
</section>

output:
<section />
<h1>Hello</h1>

Posted by Community Admin on 19-Oct-2012 00:00

Hey Vibrantice,

Sitefinity's Editor is an xhtml editor - meaning it'll try and strip out any non xhtml valid tags, so its not necessarily a Sitefinity bug, but more a RadEditor filter issue.

(check this thread: www.telerik.com/.../radeditor-partially-strips-out-html5-microdata.aspx )

There is a Administration setting to set content filters from 'DefaultFilters' to something else BUT due to a Bug in Sitefinity that's not being applied. (Bug's not fixed in v5.2 as far as I'm aware)

So basically, unless you want to go out and try a code route to overcome the bug (and thus break upgrade ability) you're not going to get that working. If you'd like the code snippets, just sent me an email or hit me up on Twitter: jbokkers so I'll forward the solution to you.

Jochem

Posted by Community Admin on 19-Oct-2012 00:00

Thank you for the reply.  I really don't want to muck with the code base.  I think converting those tags to divs with classes will be the easiest short-term solution until the bug is fixed.   Is a bug fix planned any time soon?

Posted by Community Admin on 20-Oct-2012 00:00

I've had it reported for at least a couple releases...nobody REALLY knows what bugs will get fixed when, but 5.3 will be no major features, just bug fixes and enhancements

Posted by Community Admin on 21-Oct-2012 00:00

Hey Vibrantice,

Most likely not in v5.3 yet entirely. Sitefinity 'under water' uses sort of different kind of editors - one for templates and one for pages. Hence also the reason why we haven't got shared content in templates no more.

So while hopefully the ContentFilter bug will be fixed for 5.3, it will only be applicable to the 'page' editor and not the 'template' editor.

Jochem

Posted by Community Admin on 23-Oct-2012 00:00

I can't remember exactly what the problem was but I ran into an issue with RadEditor stripping stuff out so I entered it into the HTML view then hit publish. (As opposed to entering it in HTML them clicking back to design to verify it was correct...)

It seems, to me, that some of the "cleaner" code is only run when you toggle back to Design view.

Posted by Community Admin on 24-Oct-2012 00:00

Hey Tim,

You're right on a page content block, editing html without switching back to design works (thank god for bugs sometimes ;) but that unfortunately doesn't work on a template level...

Jochem

Posted by Community Admin on 24-Oct-2012 00:00

There also seems to be code in the contentblock designer.js (btw) to client-side toggle between the modes to kick-off the filters

Happens in applyChanges, so going back in (in theory, haven't tested) would wipe them out.

Posted by Community Admin on 25-Oct-2012 00:00

@Steve,

It does in reality.
Only pasting directly into the HTML tab and hitting save works kinda for page-level content blocks. Anything else (re-editing, switching tabs, standing-on-your-head) will affect the pasted mark-up.

That in itself is also a bug, but lets get the contentfilter apply bug fixed first :)

This thread is closed