If you use the in-browser HTML editor that comes with SharePoint 2010, when you insert certain CSS selectors (like nth-child
) or any JavaScript at all, SharePoint will strip those elements out before saving the page. One could argue that this is for security, but on an intranet site it doesn't matter (what security threat could nth-child
pose? Really?).
So I'm getting frustrated at how much SharePoint decides it wants to strip out of whatever HTML you enter in, and I'd like to know how to disable that, so I can enter whatever I like in the HTML editor.
Or am I asking for too much, and is there another, easier way to edit pages without having anything removed?
This is a 2 part question since the styles need to be addressed in one way and the JavaScript in another.
"If the HTML editor detects new Cascading Style Sheet (CSS) classes whose names have the prefix ms-rteCustom-XXXX, where XXXX is the display name of the classes unique to the page, it displays the new set of custom styles instead of the default set."
http://msdn.microsoft.com/en-us/library/ms551040.aspx
SharePoint 2010 HTML Editor does not like in-line scripts. Instead you should save the script as a text file and reference it in the HTML editor:
http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With