The “Designer” in SharePoint Designer is used a little too liberally I think, but regardless here are two issues that SharePoint Designer does to your markup when saving the file. As far as I know this issue happens in both the 2007 and 2010 versions. Also, despite looking through all the program’s options, I can’t find one that causes this behavior to turn it off.
Designer Removes Closing HTML Tags
The first is that it removes closing HTML tags. This happens when you use the shorthand to close a SharePoint control. Here is what it looks like when this issue comes up.
<p>
<SharePointWebControls:fieldvalue id="BoxFourContent" FieldName="BoxFourContent"
runat="server"/>
</p>
When saving the file (in this case a page layout), SharePoint Designer removes the closing paragraph tag. To change this instead of using the shorthand to self-close the SharePoint control use the longer version.
<p>
<SharePointWebControls:fieldvalue id="BoxFourContent" FieldName="BoxFourContent"
runat="server"></SharePointWebControls:fieldvalue>
</p>
Designer Adds a Non-Breaking Space Character
The second issue is SharePoint Designer adding a non-breaking space character when saving. Here is the markup that causes the issue.
<h2> <SharePointWebControls:fieldvalue id="PageTitle" FieldName="Title" runat="server"/> </h2>
In this case simply wrap the control in a span, and the issue goes away. Notice I am using a self-closing tag, yet for some reason in this instance (in the very same document) it doesn’t remove the closing HTML tag. Perplexing.
<h2><span> <SharePointWebControls:fieldvalue id="PageTitle" FieldName="Title" runat="server"/> </span></h2>
The first rule of a good web design tool: don’t mess with my markup.