Try to replace `URI.escape` with Addressable

This commit is contained in:
Pat Hawks 2017-01-05 18:01:00 -06:00
parent 6fb05e0799
commit 5652c10305
No known key found for this signature in database
GPG Key ID: F1746FF5F18B3D1B
1 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,4 @@
require "addressable/uri"
require "uri"
# Public: Methods that generate a URL for a resource such as a Post or a Page.
#
@ -146,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")
end
# Unescapes a URL path segment