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.

This page was last updated on 2008-06-21, 16:26.

2 Notes

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

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.

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.