Don't include a double slash when rewriting the URL

This commit is contained in:
Sean McGivern 2018-07-06 13:44:45 +01:00
parent 827712e78e
commit 25664f89ac
1 changed files with 4 additions and 1 deletions

View File

@ -22,7 +22,10 @@ module Gitlab
markdown_text.gsub(MARKDOWN_SIMPLE_IMAGE) do
if $~[:image]
"![#{$~[:title]}](#{Gitlab.config.gitlab.url}/#{$~[:url]})"
url = $~[:url]
url = "/#{url}" unless url.start_with?('/')
"![#{$~[:title]}](#{Gitlab.config.gitlab.url}#{url})"
else
$~[0]
end