Page link may contain duplicate starting forward slashes.
//page points to http://page/ when what we want is
/page pointing to http://localhost:1234/page
This commit is contained in:
bootstraponline
2012-10-13 09:53:25 -06:00
parent c43fd9fa6c
commit 2f3dd3d227
+6
View File
@@ -407,6 +407,12 @@ module Gollum
presence = "present"
end
link = ::File.join(@wiki.base_path, page ? page.escaped_url_path : CGI.escape(link_name))
# //page is invalid
# strip all duplicate forward slashes using helpers.rb clean_url
# //page => /page
link = clean_url link
%{<a class="internal #{presence}" href="#{link}#{extra}">#{name}</a>}
end
end