提交 db8f70d5 编写于 作者: G Grzegorz Bizon

Do not rewrite reference if already a cross reference

上级 91963267
......@@ -49,12 +49,14 @@ module Gitlab
def unfold_reference(reference, match, target_project)
before = @text[0...match.begin(0)]
after = @text[match.end(0)..-1]
referable = find_referable(reference)
referable = find_referable(reference)
return reference unless referable
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
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册