summaryrefslogtreecommitdiff
path: root/lib/banzai
diff options
context:
space:
mode:
authorPatrick Derichs <pderichs@gitlab.com>2019-05-03 15:09:20 +0200
committerPatrick Derichs <pderichs@gitlab.com>2019-05-03 15:09:20 +0200
commitb0fbf001dab134b6638411f0be209bc0d1460519 (patch)
treec41e20aa70a1be6921246cdbbbb42382b4fd9e5b /lib/banzai
parent9f8123d935679582ac4f1487e1dcb559863372cb (diff)
downloadgitlab-ce-b0fbf001dab134b6638411f0be209bc0d1460519.tar.gz
Fix url redaction for issue links
Add changelog entry Add missing href to all redactor specs and removed href assignment Remove obsolete spec If original_content is given, it should be used for link content
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/redactor.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/banzai/redactor.rb b/lib/banzai/redactor.rb
index 7db5f5e1f7d..c2da7fec7cc 100644
--- a/lib/banzai/redactor.rb
+++ b/lib/banzai/redactor.rb
@@ -70,8 +70,11 @@ module Banzai
# Build the raw <a> tag just with a link as href and content if
# it's originally a link pattern. We shouldn't return a plain text href.
original_link =
- if link_reference == 'true' && href = original_content
- %(<a href="#{href}">#{href}</a>)
+ if link_reference == 'true'
+ href = node.attr('href')
+ content = original_content
+
+ %(<a href="#{href}">#{content}</a>)
end
# The reference should be replaced by the original link's content,