diff options
Diffstat (limited to 'lib/gitlab/markdown.rb')
-rw-r--r-- | lib/gitlab/markdown.rb | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index 05c118b81a1..92c9327070b 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -115,15 +115,17 @@ module Gitlab suffix = $~[:suffix] type = TYPES.select{|t| !$~[t].nil?}.first - next unless type - - identifier = $~[type] - - # Avoid HTML entities - if prefix && suffix && prefix[0] == '&' && suffix[-1] == ';' - match - elsif ref_link = reference_link(type, identifier) - "#{prefix}#{ref_link}#{suffix}" + if type + identifier = $~[type] + + # Avoid HTML entities + if prefix && suffix && prefix[0] == '&' && suffix[-1] == ';' + match + elsif ref_link = reference_link(type, identifier) + "#{prefix}#{ref_link}#{suffix}" + else + match + end else match end |