summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-04-14 19:01:09 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-04-20 13:01:45 -0400
commit5b6c1a2182bfd1aa7b816c6654f38268ff597c2e (patch)
tree86fbd8108f9fa272191936b15fb0e313c3896685 /lib
parentb3b8fc6c8a559b743d98577d07bc45a884e242a3 (diff)
downloadgitlab-ce-5b6c1a2182bfd1aa7b816c6654f38268ff597c2e.tar.gz
Fix Issue and ExternalIssue reference specs
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/markdown/external_issue_reference_filter.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/markdown/external_issue_reference_filter.rb b/lib/gitlab/markdown/external_issue_reference_filter.rb
index 3ca8eb7e4a7..c45cc805c71 100644
--- a/lib/gitlab/markdown/external_issue_reference_filter.rb
+++ b/lib/gitlab/markdown/external_issue_reference_filter.rb
@@ -1,6 +1,8 @@
module Gitlab
module Markdown
# HTML filter that replaces external issue tracker references with links.
+ # References are ignored if the project doesn't use an external issue
+ # tracker.
class ExternalIssueReferenceFilter < ReferenceFilter
# Public: Find `JIRA-123` issue references in text
#
@@ -23,6 +25,8 @@ module Gitlab
ISSUE_PATTERN = /(?<issue>([A-Z\-]+-)\d+)/
def call
+ return doc if project.default_issues_tracker?
+
replace_text_nodes_matching(ISSUE_PATTERN) do |content|
issue_link_filter(content)
end