Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

"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?

share|improve this question

4 Answers 4

up vote 1 down vote accepted

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

Check out this link.

share|improve this answer
1  
Thanks! Bil Simser's example in the comments is scary indeed! –  Christophe Sep 1 '10 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 '11 at 12:37

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.

share|improve this answer
    
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 '10 at 6:14

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

share|improve this answer
    
Rob, how is this article related to this question? –  Christophe Nov 24 '10 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 '10 at 4:11
1  
ok, then you might be interested in this one: blog.pathtosharepoint.com/2010/10/27/… –  Christophe Nov 25 '10 at 6:38
    
Very nice. Thank you. –  Rob Wilson Nov 25 '10 at 14:30

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/

share|improve this answer
    
Right, the article was actually written by...me :-) –  Christophe Sep 1 '11 at 4:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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