summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-07 12:26:05 +0100
committerDouwe Maan <douwe@gitlab.com>2016-01-07 12:26:05 +0100
commit539b41929bddf0e82d986f9e823208dd92707a21 (patch)
treeb63069557b6303a57ea36f33f1a80aa3618ec43d /app
parentb38eabdaf69c4da19f39c26b7626e9ce4b51158b (diff)
downloadgitlab-ce-539b41929bddf0e82d986f9e823208dd92707a21.tar.gz
Milestone reference is a Markdown linkmilestone-ref
Diffstat (limited to 'app')
-rw-r--r--app/models/milestone.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index eaa2db2e247..550d14d4c39 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -71,8 +71,12 @@ class Milestone < ActiveRecord::Base
end
def to_reference(from_project = nil)
+ escaped_title = self.title.gsub("]", "\\]")
+
h = Gitlab::Application.routes.url_helpers
- h.namespace_project_milestone_url(self.project.namespace, self.project, self)
+ url = h.namespace_project_milestone_url(self.project.namespace, self.project, self)
+
+ "[#{escaped_title}](#{url})"
end
def reference_link_text(from_project = nil)