smarty_pants

The Smarty Pants modifier enables a broad set of typographical improvements to your punctuation, based on John Gruber's original work to fix typography on the web. Since Movable Type 4, Smart Pants has been built in to Movable Type's template tags, so that you can apply the following transformations to any text you publish:

  • Straight quotes ( " and ' ) into "curly" quote HTML entities
  • Backticks-style quotes (``like this'') into "curly" quote HTML entities
  • Dashes ("--" and "---") into en- and em-dash entities
  • Three consecutive dots ("...") into an ellipsis entity

Type: modifier

Example

To enable Smart Pants, just add the modifier to your template tag. Note: If you use MT4's built-in "Markdown with SmartyPants" option while creating posts, you do not need to add this attribute to your templates.

<mt:EntryBody smarty_pants="1">

This page was last updated on 2008-12-09, 17:56.

1 Note

A couple of notes:

  1. People using the old plugin version of Smarty Pants may have this line in their templates:

mt:EntryBody smartypants="1"

without the underscore in smarty_pants. So templates may need to have an underscore added.

  1. For entries that use EntryMore, you may also have to do this:

mt:EntryMore smarty_pants="1"

  1. Some versions of the old Smarty Pants plugin didn't work with dynamic pages. Could you add a note to this page indicating whether the new integrated version works with dynamic pages?

  2. Possible typo: "To enable Smart Pants"--presumably should say "Smarty Pants".

Leave a note

Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.