SharePoint 2013 Word Cut and Paste

​Cutting and pasting content from Word into SharePoint is something that every content author on a WCM site needs to do.  One of the first things we stress in our WCM training is to make sure you paste as plain text.  Pasting the rich text results in poorly formed HTML that causes all sorts of problems later for both authors and consumers.

To give you a sense of how this works, I started with a small amount of Word content from an earlier post.  You can see the content in Word below.



Pasting this content into SharePoint 2010 resulted in the following HTML.

<h2 style="margin: 10pt 0in 0pt"><font size="4"><font color="#4f81bd"><font face="Cambria">Composed Looks</font></font></font></h2>
<div><font face="Calibri">Composed looks are essentially SharePoint themes. They consist of several components:</font></div>
<ul type="disc" style="margin-top: 0in"><li class="MsoNormal" style="margin: 0in 0in 10pt; tab-stops: list .5in"><font face="Calibri"><b>Name </b>– the name of the Composed Look</font></li>
<li class="MsoNormal" style="margin: 0in 0in 10pt; tab-stops: list .5in"><font face="Calibri"><b>Master Page</b> – for defining the overall layout of the site</font></li>
<li class="MsoNormal" style="margin: 0in 0in 10pt; tab-stops: list .5in"><font face="Calibri"><b>Theme URL </b>– Points to an XML file that defines all of the colors you want to apply to different CSS. This works similarly to 2010 except you make your own theme id’s instead of using Accent1, Accent2, etc.</font></li>
<li class="MsoNormal" style="margin: 0in 0in 10pt; tab-stops: list .5in"><font face="Calibri"><b>Image URL</b> – Points to an image that can be used to replace a background image in the CSS</font></li>
<li class="MsoNormal" style="margin: 0in 0in 10pt; tab-stops: list .5in"><font face="Calibri"><b>Font Scheme URL </b>– Points to an XML file which defines the fonts that can be applied to CSS</font></li>
<li class="MsoNormal" style="margin: 0in 0in 10pt; tab-stops: list .5in"><font face="Calibri"><b>Display Order</b> – Helps you arrange the available composed looks</font></li></ul>
<div><font face="Calibri">Composed looks could be useful for creating a standard set of site templates for client use.</font></div>
<div><font face="Calibri">&#160;</font></div>

You can see all the font style, colour, size, and class information that gets embedded in the HTML.  This pretty much ruins the ability of the site's CSS to apply standard layout to the content.  Yes you can use the format eraser to remove most of this, but it is an error-prone process.

When I pasted the exact same content into SharePoint 2013, the following HTML was generated.

<h2><strong>Composed Looks</strong></h2>
<p>Composed looks are essentially SharePoint themes. They consist of several components:</p>
<ul style="list-style-type: disc;">
   <li>
      <strong>Name </strong>– the name of the Composed Look</li>
   <li>
      <strong>Master Page</strong> – for defining the overall layout of the site</li>
   <li>
      <strong>Theme URL </strong>– Points to an XML file that defines all of the colors you want to apply to different CSS. This works similarly to 2010 except you make your own theme id&#39;s instead of using Accent1, Accent2, etc.</li>
   <li>
      <strong>Image URL</strong> – Points to an image that can be used to replace a background image in the CSS</li>
   <li>
      <strong>Font Scheme URL </strong>– Points to an XML file which defines the fonts that can be applied to CSS</li>
   <li>
      <strong>Display Order</strong> – Helps you arrange the available composed looks</li>
</ul>
<p>Composed looks could be useful for creating a standard set of site templates for client use.</p>

As you can see the above HTML is much cleaner.  There is no overriding of fonts or classes, so the content adopts the style of the site, which is generally what is desired.

I'm thrilled to see this feature, and I'm sure content authors worldwide will be just as thrilled when they get their hands on SharePoint 2013. 

0 Comments


Leave a Comment

Name  
Email (will not be published)    
Comment  
 
Enter both words, separated by a space.