From 31f007f79fda5814902fd8e9be5733ce6611781f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 16 May 2013 12:54:10 +0300 Subject: [PATCH] Fix skipping of some elements in makrdown --- lib/gitlab/markdown.rb | 20 +++++++++++--------- 1 file 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 -- GitLab