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

Allow colons in uri_escape filter Fixes #5954 #5957

Merged
merged 2 commits into from Mar 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/jekyll/filters.rb
Expand Up @@ -152,7 +152,7 @@ def cgi_escape(input)
#
# Returns the escaped String.
def uri_escape(input)
Addressable::URI.encode(input)
Addressable::URI.normalize_component(input)
end

# Replace any whitespace in the input string with a single space
Expand Down
5 changes: 5 additions & 0 deletions test/test_filters.rb
Expand Up @@ -317,6 +317,11 @@ def select; end
assert_equal "my%20things", @filter.uri_escape("my things")
end

should "allow colons in URI" do
assert_equal "foo:bar", @filter.uri_escape("foo:bar")
assert_equal "foo%20bar:baz", @filter.uri_escape("foo bar:baz")
end

context "absolute_url filter" do
should "produce an absolute URL from a page URL" do
page_url = "/about/my_favorite_page/"
Expand Down