summaryrefslogtreecommitdiff
path: root/lib/banzai
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-10-05 19:53:10 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-10-05 19:53:10 +0200
commitca9b99ffbb944f9ac27814c17139add24a517962 (patch)
treea1a0472937f399a1bf7a8fddf01998f571f76e93 /lib/banzai
parent34646406f71f79d4581a4a1cb9cddea38ffbb8be (diff)
parent36bd07838263f709b0ca9af4830ee75cde7e8f97 (diff)
downloadgitlab-ce-ca9b99ffbb944f9ac27814c17139add24a517962.tar.gz
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/object_renderer.rb1
-rw-r--r--lib/banzai/redactor.rb8
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/banzai/object_renderer.rb b/lib/banzai/object_renderer.rb
index a176f1e261b..7137c1da57d 100644
--- a/lib/banzai/object_renderer.rb
+++ b/lib/banzai/object_renderer.rb
@@ -38,6 +38,7 @@ module Banzai
redacted_data = redacted[index]
object.__send__("redacted_#{attribute}_html=", redacted_data[:document].to_html(save_options).html_safe) # rubocop:disable GitlabSecurity/PublicSend
object.user_visible_reference_count = redacted_data[:visible_reference_count] if object.respond_to?(:user_visible_reference_count)
+ object.total_reference_count = redacted_data[:total_reference_count] if object.respond_to?(:total_reference_count)
end
end
diff --git a/lib/banzai/redactor.rb b/lib/banzai/redactor.rb
index 28928d6f376..e77bee78496 100644
--- a/lib/banzai/redactor.rb
+++ b/lib/banzai/redactor.rb
@@ -37,7 +37,13 @@ module Banzai
all_document_nodes.each do |entry|
nodes_for_document = entry[:nodes]
- doc_data = { document: entry[:document], visible_reference_count: nodes_for_document.count }
+
+ doc_data = {
+ document: entry[:document],
+ total_reference_count: nodes_for_document.count,
+ visible_reference_count: nodes_for_document.count
+ }
+
metadata << doc_data
nodes_for_document.each do |node|