Class: Blacklight::MetadataFieldPlainTextLayoutComponent

Inherits:
MetadataFieldLayoutComponent show all
Defined in:
app/components/blacklight/metadata_field_plain_text_layout_component.rb

Constant Summary

Constants inherited from Component

Component::EXCLUDE_VARIABLES

Instance Method Summary collapse

Methods inherited from Component

compiler, config, #inspect

Constructor Details

#initialize(field:, **kwargs) ⇒ MetadataFieldPlainTextLayoutComponent

Returns a new instance of MetadataFieldPlainTextLayoutComponent.



7
8
9
# File 'app/components/blacklight/metadata_field_plain_text_layout_component.rb', line 7

def initialize(field:, **kwargs)
  super(field: field, **kwargs, value_tag: nil)
end

Instance Method Details

#callObject

rubocop:disable Rails/OutputSafety



12
13
14
# File 'app/components/blacklight/metadata_field_plain_text_layout_component.rb', line 12

def call
  [label.to_s.strip, helpers.strip_tags(CGI.unescape_html(safe_join(values, "\n")).strip)].compact.join(' ').html_safe
end