From 5652c10305f204299544869e95f41d3b5a451328 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Thu, 5 Jan 2017 18:01:00 -0600 Subject: [PATCH] Try to replace `URI.escape` with Addressable --- lib/jekyll/url.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/url.rb b/lib/jekyll/url.rb index c630b539..072ea8cd 100644 --- a/lib/jekyll/url.rb +++ b/lib/jekyll/url.rb @@ -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