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

Makes uri_escape template docs more specific. #5887

Merged
merged 1 commit into from Feb 17, 2017

Conversation

Projects
None yet
4 participants
@philnash
Contributor

philnash commented Feb 17, 2017

I didn't know the difference between cgi_escape and uri_escape until it bit me when I had a colon in a title I used uri_escape on. Addressable::URI.encode (from addressable 2.4.0 and later) thought it was a URI and raised an error. I should have been using cgi_escape, which is for strings that will be added to URIs and not uri_escape, which is for encoding strings that are already in a URI.

This commit borrows from the addressable docs to make the uri_escape explanation more specific so that readers choose uri_escape when they already have a URI and cgi_escape when they are just escaping a plain string.

Makes uri_escape template docs more specific.
I didn't know the difference between cgi_escape and uri_escape until it bit me when I had a colon in a title I used uri_escape on. Addressable::URI.encode (from addressable 2.4.0 and later) thought it was a URI and raised an error. I should have been using cgi_escape, which is for strings that will be added to URIs and not uri_escape, which is for encoding strings that are already in a URI.

This commit borrows from the addressable docs to make it more specific so that readers choose uri_escape when they already have a URI and cgi_escape when they are just escaping a plain string.
@DirtyF

DirtyF approved these changes Feb 17, 2017

Thanks for the clarification @philnash

@oe

oe approved these changes Feb 17, 2017

@oe

This comment has been minimized.

Show comment
Hide comment
@oe

oe Feb 17, 2017

Member

@jekyllbot: merge +docs

Member

oe commented Feb 17, 2017

@jekyllbot: merge +docs

@jekyllbot jekyllbot merged commit 8367d73 into jekyll:master Feb 17, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

jekyllbot added a commit that referenced this pull request Feb 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment