Escape text passed to gfm by link_to_gfm
This commit is contained in:
parent
01974185a1
commit
496f88afe1
3 changed files with 12 additions and 5 deletions
|
@ -12,8 +12,8 @@ module GitlabMarkdownHelper
|
|||
# "<a>outer text </a><a>gfm ref</a><a> more outer text</a>").
|
||||
def link_to_gfm(body, url, html_options = {})
|
||||
return "" if body.blank?
|
||||
|
||||
gfm_body = gfm(body, html_options)
|
||||
|
||||
gfm_body = gfm(escape_once(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…
Add table
Add a link
Reference in a new issue