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
Léo-Paul Géneau
gitlab-ce
Commits
e64b1e52
Commit
e64b1e52
authored
Mar 30, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check if GFM rewriters need rewrite internally
parent
d08de5ed
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
app/services/issues/move_service.rb
app/services/issues/move_service.rb
+1
-1
lib/gitlab/gfm/reference_rewriter.rb
lib/gitlab/gfm/reference_rewriter.rb
+2
-0
lib/gitlab/gfm/uploads_rewriter.rb
lib/gitlab/gfm/uploads_rewriter.rb
+1
-1
No files found.
app/services/issues/move_service.rb
View file @
e64b1e52
...
...
@@ -69,7 +69,7 @@ module Issues
rewriters
.
inject
(
content
)
do
|
text
,
klass
|
rewriter
=
klass
.
new
(
text
,
@old_project
,
@current_user
)
rewriter
.
needs_rewrite?
?
rewriter
.
rewrite
(
@new_project
)
:
text
rewriter
.
rewrite
(
@new_project
)
end
end
...
...
lib/gitlab/gfm/reference_rewriter.rb
View file @
e64b1e52
...
...
@@ -38,6 +38,8 @@ module Gitlab
end
def
rewrite
(
target_project
)
return
@text
unless
needs_rewrite?
@text
.
gsub
(
@pattern
)
do
|
reference
|
unfold_reference
(
reference
,
Regexp
.
last_match
,
target_project
)
end
...
...
lib/gitlab/gfm/uploads_rewriter.rb
View file @
e64b1e52
...
...
@@ -15,7 +15,7 @@ module Gitlab
end
def
rewrite
(
target_project
)
return
unless
@text
return
@text
unless
needs_rewrite?
new_uploader
=
file_uploader
(
target_project
)
@text
.
gsub
(
@pattern
)
do
|
markdown
|
...
...
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