Check if GFM rewriters need rewrite internally
This commit is contained in:
parent
d08de5ed0e
commit
e64b1e52a2
3 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
Loading…
Reference in a new issue