diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-10-05 19:53:10 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-10-05 19:53:10 +0200 |
commit | ca9b99ffbb944f9ac27814c17139add24a517962 (patch) | |
tree | a1a0472937f399a1bf7a8fddf01998f571f76e93 /lib/banzai | |
parent | 34646406f71f79d4581a4a1cb9cddea38ffbb8be (diff) | |
parent | 36bd07838263f709b0ca9af4830ee75cde7e8f97 (diff) | |
download | gitlab-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.rb | 1 | ||||
-rw-r--r-- | lib/banzai/redactor.rb | 8 |
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| |