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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
db8f70d5
Commit
db8f70d5
authored
Mar 21, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not rewrite reference if already a cross reference
parent
91963267
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lib/gitlab/gfm/reference_rewriter.rb
lib/gitlab/gfm/reference_rewriter.rb
+4
-2
No files found.
lib/gitlab/gfm/reference_rewriter.rb
View file @
db8f70d5
...
@@ -49,12 +49,14 @@ module Gitlab
...
@@ -49,12 +49,14 @@ module Gitlab
def
unfold_reference
(
reference
,
match
,
target_project
)
def
unfold_reference
(
reference
,
match
,
target_project
)
before
=
@text
[
0
...
match
.
begin
(
0
)]
before
=
@text
[
0
...
match
.
begin
(
0
)]
after
=
@text
[
match
.
end
(
0
)
..-
1
]
after
=
@text
[
match
.
end
(
0
)
..-
1
]
referable
=
find_referable
(
reference
)
referable
=
find_referable
(
reference
)
return
reference
unless
referable
return
reference
unless
referable
cross_reference
=
referable
.
to_reference
(
target_project
)
cross_reference
=
referable
.
to_reference
(
target_project
)
new_text
=
before
+
cross_reference
+
after
return
reference
if
reference
==
cross_reference
new_text
=
before
+
cross_reference
+
after
substitution_valid?
(
new_text
)
?
cross_reference
:
reference
substitution_valid?
(
new_text
)
?
cross_reference
:
reference
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