Fix internal paths with ':' characters not getting clean up properly

Fix #402.
pull/407/head
Thibaut Courouble 9 years ago
parent 84566eac80
commit 2813cf9be3

@ -85,5 +85,9 @@ module Docs
URI.decode(result)
end
def clean_path(path)
path.gsub %r{[!;:]+}, '-'
end
end
end

@ -81,6 +81,7 @@ module Docs
def internal_path_to(url)
url = index_url if url == root_url
path = effective_url.relative_path_to(url)
path = clean_path(path) if context[:decode_and_clean_paths]
URL.new(path: path, query: url.query, fragment: url.fragment).to_s
end

@ -37,7 +37,7 @@ module Docs
if context[:decode_and_clean_paths]
path = URI.unescape(path)
path.gsub! %r{[!;:]+}, '-'
path = clean_path(path)
end
if path == '.'

Loading…
Cancel
Save