escape
Similar to the encode_*
modifiers. The input is reformatted so that certain special characters are translated depending on the value of the escape
attribute. There are two primary differences between “encode” and “escape”:
Usage: The “encode” modifiers use the “1” style — where you specify the tag as
encode*="1"
(for instance). With theescape
modifier you instead specifyescape="js"
, for example.The more important difference is the result: the
encode_*
modifiers will encode just about every character — spaces turn into%20
and you often get a mess if you want to read the result. For most uses, you’re probably more likely to useescape
.
Attributes
html
: Similar to theencode_html
modifier. Escapes special characters as HTML entities.url
: Similar to theencode_url
modifier. Escapes special characters using a URL-encoded format (ie, “ ” becomes “%20”).javascript
orjs
: Similar to theencode_js
modifier. Escapes special characters such as quotes, newline characters, etc., so that the input can be placed in a JavaScript string.mail
: A very simple email obfuscation technique.
Examples
<mt:EntryTitle escape="url">
The escape
modifier can also be used multiple times:
<mt:EntryTitle escape="html" escape="js">