diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-01-07 12:26:05 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-01-07 12:26:05 +0100 |
commit | 539b41929bddf0e82d986f9e823208dd92707a21 (patch) | |
tree | b63069557b6303a57ea36f33f1a80aa3618ec43d /app | |
parent | b38eabdaf69c4da19f39c26b7626e9ce4b51158b (diff) | |
download | gitlab-ce-539b41929bddf0e82d986f9e823208dd92707a21.tar.gz |
Milestone reference is a Markdown linkmilestone-ref
Diffstat (limited to 'app')
-rw-r--r-- | app/models/milestone.rb | 6 |
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) |