Skip to main content

Why does SiteBuilder remove some HTML?

We recommend you use the content editor to create content in SiteBuilder. However, there may be occasions when you wish to copy information from other sources, e.g. a Word document, into the editor. Unfortunately, Word can produce HTML in an unsuitable form way that's not standard or accessible. Word can also produce content that doesn't conform to established usability standards and the University's common website template e.g. underlining text that is not a link.

For this reason, SiteBuilder cleans up the HTML when a page is published. Most users will not be affected by this and will see a benefit from a more standards-compliant page. However, it may be the case that you add custom HTML to achieve a particular effect that, while conforming to usability standards, is still removed by the clean-up process when publishing.

Custom code that is removed

SiteBuilder removes the following HTML tags and attributes automatically when you publish a page:

Tags

  • u
  • font
  • placetype
  • placename
  • place
  • city
  • country-region
  • time
  • date
  • notextile

Attributes

  • span: style, lang
  • h1: style
  • h2: style
  • h3: style
  • h4: style
  • h5: style
  • h6: style
  • b: style
  • i: style
  • p: style
  • strong: style
  • em: style

Custom code that is not removed

As you can see from the list above, most of the attributes removed automatically are style attributes. This is, in the vast majority of cases, done to clean up Word content – not to enforce usability requirements on those who wish to use custom code. When you want to style an element, the easiest way to work around the restrictions is to abstract the style information into style tags and use a class on the element.

For example, SiteBuilder will clean the following code and remove the style attribute:

<p style="margin-bottom: 2em;">Some text here.</p>

To achieve the desired effect, move the style information to a style tag and use a class:

<style>
p.extra-line-spaceing { margin-bottom: 2em; }
</style>

<p class="extra-line-spacing">Some text here.</p>

Related FAQs

Support

Telephone 73737
Email webteam at warwick dot ac dot uk
How to report a problem