From 3682a0820be8c5e3b6f368cb121fca3f23fc6f87 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Tue, 8 Oct 2013 15:38:24 +0200 Subject: [PATCH] Match the brackets so we don't replace the regular text. --- app/helpers/gitlab_markdown_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index fcb7f91..bd0dd22 100644 --- a/app/helpers/gitlab_markdown_helper.rb +++ b/app/helpers/gitlab_markdown_helper.rb @@ -64,11 +64,11 @@ module GitlabMarkdownHelper links.each do |string| new_link = [ project_path_with_namespace, - wiki ? "wiki":"blob", + wiki ? "wikis":"blob", ref, string ].compact.join("/") - text.gsub!(string, "/#{new_link}") + text.gsub!("](#{string})", "](/#{new_link})") end text end -- libgit2 0.21.2