only encode if current path is broken
This commit is contained in:
parent
4ffaa9dde5
commit
51ccfe1143
|
@ -158,10 +158,14 @@ module Middleman
|
||||||
|
|
||||||
# Try to parse URL
|
# Try to parse URL
|
||||||
begin
|
begin
|
||||||
uri = URI(::URI.encode(url))
|
uri = URI(url)
|
||||||
rescue ::URI::InvalidURIError
|
rescue ::URI::InvalidURIError
|
||||||
# Nothing we can do with it, it's not really a URI
|
begin
|
||||||
return url
|
uri = URI(::URI.encode(url))
|
||||||
|
rescue ::URI::InvalidURIError
|
||||||
|
# Nothing we can do with it, it's not really a URI
|
||||||
|
return url
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
relative = options[:relative]
|
relative = options[:relative]
|
||||||
|
|
Loading…
Reference in a new issue