4

"the HTML source you entered might have been modified"

In SharePoint 2010, this is the scary message you get everytime you use the "edit HTML source" button with the Content Editor Web Part.

In which cases would the HTML source actually be modified? Has anyone experienced it?

4 Answers 4

1

http://blah.winsmarts.com/2009-11-The_new_content_editor_WebPart_in_SharePoint_2010.aspx

Check out this link.

2
  • 1
    Thanks! Bil Simser's example in the comments is scary indeed!
    – Christophe
    Sep 1, 2010 at 6:18
  • Bill's comments show the CE Web Part is actually a step backward in some terms, but a step forward in others. It goes a little bit further to prevent users from breaking sites by pasting in javascript & html willy-nilly.
    – James Love
    Aug 31, 2011 at 12:37
3

I think the warning displays universally -- just to let you know that something may have changed whether you actually changed the content or not. It even displays when you simply click ok after opening the form.

When it actually changes the source is when you use something that it doesn't like. For example, if you put the bold tag around content, it will move the content outside of the tags and leave the tags empty. Don't know why it does this, but it likes to use the strong tag.

1
  • You're correct, the warning displays universally, that's what freaks me out. I'd rather have a warning only when something is actually modified. Thanks for the "bold" example.
    – Christophe
    Sep 1, 2010 at 6:14
2

This happened again recently when trying to use the CEWP for some inline style code to hide the QuickLaunch. It changed the code so horribly that it wouldn't execute. This article helped me immensely: http://sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?List=676af157-7d96-4e15-a987-54b8a3e4d948&ID=64

3
  • Rob, how is this article related to this question?
    – Christophe
    Nov 24, 2010 at 23:45
  • By putting your content (markup in thus case) in a text file in the site assets folder instead if in the CEWP, you are able to get around SharePoint changing it.
    – Rob Wilson
    Nov 25, 2010 at 4:11
  • 1
    ok, then you might be interested in this one: blog.pathtosharepoint.com/2010/10/27/…
    – Christophe
    Nov 25, 2010 at 6:38
1

I found this post which explain how to avoid the problem. Quickly explained use the HTML Form Web Part instead :)

http://blog.pathtosharepoint.com/2010/10/27/about-scripts-web-parts-and-urban-myths/

1
  • 1
    Right, the article was actually written by...me :-)
    – Christophe
    Sep 1, 2011 at 4:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.