summaryrefslogtreecommitdiff
path: root/lib/banzai/redactor.rb
diff options
context:
space:
mode:
authorpanjan <panjan@panjan.cz>2016-09-30 11:03:16 +0200
committerSean McGivern <sean@gitlab.com>2016-11-01 09:49:30 +0000
commit6b4c6fa193d1f831e272b03cec605e702069770c (patch)
tree6809014d9116ac7b24453b9962375a66cce145b9 /lib/banzai/redactor.rb
parent266fcfb1935c8aa8c6ac3d2ae71530c441b08675 (diff)
downloadgitlab-ce-6b4c6fa193d1f831e272b03cec605e702069770c.tar.gz
Fix Markdown styling inside reference links
Fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/18096
Diffstat (limited to 'lib/banzai/redactor.rb')
-rw-r--r--lib/banzai/redactor.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/banzai/redactor.rb b/lib/banzai/redactor.rb
index 0df3a72d1c4..de3ebe72720 100644
--- a/lib/banzai/redactor.rb
+++ b/lib/banzai/redactor.rb
@@ -41,10 +41,10 @@ module Banzai
next if visible.include?(node)
doc_data[:visible_reference_count] -= 1
- # The reference should be replaced by the original text,
- # which is not always the same as the rendered text.
- text = node.attr('data-original') || node.text
- node.replace(text)
+ # The reference should be replaced by the original link's content,
+ # which is not always the same as the rendered one.
+ content = node.attr('data-original') || node.inner_html
+ node.replace(content)
end
end