escape_utils icon indicating copy to clipboard operation
escape_utils copied to clipboard

Expose `escape_href` from Houdini

Open gjtorikian opened this issue 10 years ago • 0 comments

:wave: @brianmario. I need escape_href exposed from Houdini for a project I'm working on.

The main difference between escape_href and escape_url is that escape_href is a bit looser on the characters it allows. From Houdini's comment:

The following characters will not be escaped:

   -_.+!*'(),%#@?=;:/,+&$ alphanum

Note that this character set is the addition of:

 - The characters which are safe to be in an URL
 - The characters which are *not* safe to be in
 an URL because they are RESERVED characters.

We asume (lazily) that any RESERVED char that
appears inside an URL is actually meant to
have its native function (i.e. as an URL
component/separator) and hence needs no escaping.

The test I've added here is basically the same as escape_url's. Note that there is no unescape_href function.

gjtorikian avatar May 15 '15 18:05 gjtorikian