Merge pull request #5726 from jekyll/pull/remove-deprecated

Merge pull request 5726
This commit is contained in:
jekyllbot 2017-01-07 03:37:47 -08:00 committed by GitHub
commit 214eedc87b
2 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,4 @@
require "uri"
require "addressable/uri"
require "json"
require "date"
require "liquid"
@ -152,7 +152,7 @@ module Jekyll
#
# Returns the escaped String.
def uri_escape(input)
URI.escape(input)
Addressable::URI.encode(input)
end
# Replace any whitespace in the input string with a single space

View File

@ -1,4 +1,4 @@
require "uri"
require "addressable/uri"
# Public: Methods that generate a URL for a resource such as a Post or a Page.
#
@ -145,7 +145,8 @@ module Jekyll
# pct-encoded = "%" HEXDIG HEXDIG
# sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
# / "*" / "+" / "," / ";" / "="
URI.escape(path, %r{[^a-zA-Z\d\-._~!$&'()*+,;=:@\/]}).encode("utf-8")
path = Addressable::URI.encode(path)
path.encode("utf-8").sub("#", "%23")
end
# Unescapes a URL path segment
@ -159,7 +160,7 @@ module Jekyll
#
# Returns the unescaped path.
def self.unescape_path(path)
URI.unescape(path.encode("utf-8"))
Addressable::URI.unencode(path.encode("utf-8"))
end
end
end