summaryrefslogtreecommitdiff
path: root/lib/banzai
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejandroluis24@gmail.com>2016-04-04 22:20:10 -0300
committerAlejandro Rodríguez <alejandroluis24@gmail.com>2016-04-20 22:12:43 -0300
commit6d9794d42a7bea1150374c76fd3ce5521a44e58e (patch)
tree3be96947c2cf334f14c517f0543ac8298b0c4078 /lib/banzai
parent375e83bb57dc0143691cf6ef7277bec494f060f0 (diff)
downloadgitlab-ce-6d9794d42a7bea1150374c76fd3ce5521a44e58e.tar.gz
Transforming milestones link references to the short reference form
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/milestone_reference_filter.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/banzai/filter/milestone_reference_filter.rb b/lib/banzai/filter/milestone_reference_filter.rb
index 419532717f2..556087c4880 100644
--- a/lib/banzai/filter/milestone_reference_filter.rb
+++ b/lib/banzai/filter/milestone_reference_filter.rb
@@ -11,6 +11,11 @@ module Banzai
end
def references_in(text, pattern = Milestone.reference_pattern)
+ # We'll handle here the references that follow the `reference_pattern`.
+ # Other patterns (for example, the link pattern) are handled by the
+ # default implementation.
+ return super(text, pattern) if pattern != Milestone.reference_pattern
+
text.gsub(pattern) do |match|
project = project_from_ref($~[:project])
params = milestone_params($~[:milestone_iid].to_i, $~[:milestone_name])