Class: Banzai::Filter::InlineMetricsRedactorFilter
- Inherits:
-
HTML::Pipeline::Filter
- Object
- HTML::Pipeline::Filter
- Banzai::Filter::InlineMetricsRedactorFilter
- Includes:
- Gitlab::Utils::StrongMemoize
- Defined in:
- lib/banzai/filter/inline_metrics_redactor_filter.rb
Overview
HTML filter that removes embeded elements that the current user does not have permission to view.
Defined Under Namespace
Constant Summary collapse
- METRICS_CSS_CLASS =
'.js-render-metrics'
- EMBED_LIMIT =
100
Instance Method Summary collapse
-
#call ⇒ Object
Finds all embeds based on the css class the FE uses to identify the embedded content, removing only unnecessary nodes.
Methods included from Gitlab::Utils::StrongMemoize
#clear_memoization, #strong_memoize, #strong_memoized?
Instance Method Details
#call ⇒ Object
Finds all embeds based on the css class the FE uses to identify the embedded content, removing only unnecessary nodes.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/banzai/filter/inline_metrics_redactor_filter.rb', line 19 def call nodes.each do |node| = [node] user_has_access = [] node.remove unless user_has_access end doc end |