Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 598 Bytes

escape.md

File metadata and controls

20 lines (14 loc) · 598 Bytes

Modifier escape

The modifier escapes a string for safe insertion into the output. It supports different escaping strategies depending on the template context. By default, it uses the HTML escaping strategy:

{$post.title|escape:'html'}

The modifier supports the following escaping strategies:

  • html: escapes a string for the HTML body context.
  • url: escapes a string for the URI or parameter contexts.
  • js: escapes a string for the JavaScript context.

For convenience, the e modifier is defined as an alias of escape modifier.

Second parameter is charset.