Class: Avo::Fields::LexxyField::ShowComponent

Inherits:
ShowComponent
  • Object
show all
Defined in:
app/components/avo/fields/lexxy_field/show_component.rb

Instance Method Summary collapse

Instance Method Details

#sanitized_valueObject

Lexxy content can carry tags the default sanitizer strips (video, audio, tables), so sanitize with Action Text's allowlist, which the lexxy gem extends with those tags.



7
8
9
10
11
12
13
14
15
# File 'app/components/avo/fields/lexxy_field/show_component.rb', line 7

def sanitized_value
  if defined?(ActionText::ContentHelper)
    helpers.sanitize rendered_value,
      tags: ActionText::ContentHelper.allowed_tags,
      attributes: ActionText::ContentHelper.allowed_attributes
  else
    helpers.sanitize rendered_value
  end
end