Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b41fe91e
Commit
b41fe91e
authored
Apr 27, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add result to ExternalIssueReferenceFilter
parent
2e243fc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
lib/gitlab/markdown/external_issue_reference_filter.rb
lib/gitlab/markdown/external_issue_reference_filter.rb
+7
-3
spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
...b/gitlab/markdown/external_issue_reference_filter_spec.rb
+8
-0
No files found.
lib/gitlab/markdown/external_issue_reference_filter.rb
View file @
b41fe91e
...
...
@@ -43,15 +43,19 @@ module Gitlab
def
issue_link_filter
(
text
)
project
=
context
[
:project
]
self
.
class
.
references_in
(
text
)
do
|
match
,
issue
|
url
=
url_for_issue
(
issue
,
project
,
only_path:
context
[
:only_path
])
self
.
class
.
references_in
(
text
)
do
|
match
,
id
|
issue
=
ExternalIssue
.
new
(
id
,
project
)
push_result
(
:external_issue
,
issue
)
url
=
url_for_issue
(
id
,
project
,
only_path:
context
[
:only_path
])
title
=
escape_once
(
"Issue in
#{
project
.
external_issue_tracker
.
title
}
"
)
klass
=
reference_class
(
:issue
)
%(<a href="#{url}"
title="#{title}"
class="#{klass}">#{i
ssue
}</a>)
class="#{klass}">#{i
d
}</a>)
end
end
...
...
spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
View file @
b41fe91e
...
...
@@ -104,6 +104,14 @@ module Gitlab::Markdown
expect
(
link
).
to
eq
helper
.
url_for_issue
(
"
#{
reference
}
"
,
project
,
only_path:
true
)
end
it
'adds to the results hash'
do
ext
=
JiraIssue
.
new
(
reference
,
project
)
result
=
pipeline_result
(
"Issue
#{
reference
}
"
)
expect
(
result
[
:references
][
:external_issue
]).
not_to
be_empty
expect
(
result
[
:references
][
:external_issue
]).
to
eq
[
ext
]
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment