Merge pull request #5957 from jekyll/pull/escape_colon

Merge pull request 5957
This commit is contained in:
jekyllbot 2017-03-21 09:12:16 -04:00 committed by GitHub
commit 2907825f62
2 changed files with 6 additions and 1 deletions

View File

@ -152,7 +152,7 @@ module Jekyll
#
# 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

View File

@ -317,6 +317,11 @@ class TestFilters < JekyllUnitTest
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/"