Understanding Sanitize

The main thing Sanitize does is to remove from a piece of content any HTML or XHTML markup that has not been explicitly allowed. Sanitize acts as a bouncer with a guest list that says which elements and element attributes are allowed in; if the content being sanitized contains an element or attribute that's not on the list, Sanitize strips out the unlisted element or attribute.

This filtering doesn't have any effect on the data that is actually stored in Movable Type's database, only on the content that is actually published to your site when using a template tag that inserts that data. For example, let's say the database contained a value that looked something like this:

 <p>This is a paragraph that contains <span class="foo">a ...

Get Sams Teach Yourself Movable Type in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.