From f72dc7f7798f521d20a71fb465df57f0d66befb5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 29 Jan 2013 11:00:56 +0200 Subject: [PATCH] dont escape images inside links for gfm. Fixes #2701 --- app/helpers/gitlab_markdown_helper.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index 111982e9..1a3d34eb 100644 --- a/app/helpers/gitlab_markdown_helper.rb +++ b/app/helpers/gitlab_markdown_helper.rb @@ -13,7 +13,13 @@ module GitlabMarkdownHelper def link_to_gfm(body, url, html_options = {}) return "" if body.blank? - gfm_body = gfm(escape_once(body), html_options) + escaped_body = if body =~ /^\.*?}m) do |match| "#{match}#{link_to("", url, html_options)[0..-5]}" # "".length +1