Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose escape_href from Houdini #61

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gjtorikian
Copy link

👋 @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant