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. The following modes are recognized:
- html
Similar to the 'encode_html' modifier. Escapes special characters as HTML entities.
- url
Similar to the 'encode_url' modifier. Escapes special characters using a URL-encoded format (ie, " " becomes "%20").
- javascript or js
Similar to the 'encode_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.
Berberich
September 20, 2007 8:32 AM | Reply
This page appears to be missing some content. While I can probably guess what the escape modifier does by its name alone, I'd rather have a good understand of what it does. Right now, I can't find any information about this new filter anywhere.
Thanks,
Jason
Chad Everett
April 18, 2009 6:27 AM | Reply
There are two primary differences between "encode" and "escape".
First is the usage. The "encode" modifiers use the "1" style - where you specify the tag as encode*="1" (for instance). With escape, you instead specify escape="js". If you're used to the other style, it's going to take some getting used to. But it probably makes more sense.
The other difference is in what you get. Encode will encode just about everything - spaces turn into %20 and you get a mess - though it serves it's purpose. For most people, you're probably more likely to use escape.
In fact, I'll generally use multiple ecapes - something like and it works great.
As a bonus, you don't have any underscores in this styling, so the markdown here doesn't screw up the rendering of the comment.