Skip to content
Snippets Groups Projects
Commit f72dc7f7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

dont escape images inside links for gfm. Fixes #2701

parent 1c931fb8
No related branches found
No related tags found
2 merge requests!2940Expanding repos and hooks paths in settings,!2770Capistrano deploy
Loading
Loading
@@ -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 =~ /^\<img/
body
else
escape_once(body)
end
gfm_body = gfm(escaped_body, html_options)
 
gfm_body.gsub!(%r{<a.*?>.*?</a>}m) do |match|
"</a>#{match}#{link_to("", url, html_options)[0..-5]}" # "</a>".length +1
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment