Smartypants

URL Encode

Encodes a variable so it can be safely used in a URL. For instance, "Test Example" would become "Test%20Example".

HTML

{variable|html}

Encodes a variable so it can be safely used in HTML, replacing the characters <, >, and & with their corresponding entities. For example, <script> would become &lt;script&gt;.

HTML Attribute

{variable|htmlattr} or {variable|htmltag}

Similar to html but additionally escapes quotes, replacing the characters <, >, &, and " with their corresponding entities, to ensure it can be used in an attribute (src="X", for instance) within an HTML tag.

Truncate

{variable|truncate 250}

Limits the length of a string to the number following the formatter, and once truncated includes an ellipsis.

NOTE: should be combined with safe if truncating a string that contains HTML.

Safe

{variable|safe}

Make the variable 'safe' by stripping away unsafe HTML, such as injected script tags.

Item Count

{items|count}

Output the length of the items array

Twitter Links

{variable|activate-twitter-links}

Make links and @names link to the appropriate places on twitter. For instance, @squarespace (the string) would become @squarespace.