Sha256: bb3e5ac36a26192c03ead2b2ab9d878075aff29541f0a9d643abeb07851cac53

Contents?: true

Size: 392 Bytes

Versions: 35

Compression:

Stored size: 392 Bytes

Contents

module Krikri::Enrichments
  ##
  # Enrichment to capitalize sentences in a text field
  #
  #   StripHtml.new.enrich_value('<html>Moomin <i><b>Valley</i></b>')
  #   => 'Moomin Valley'
  #
  class StripHtml
    include Audumbla::FieldEnrichment

    def enrich_value(value)
      return value unless value.is_a? String
      ActionView::Base.full_sanitizer.sanitize(value)
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
krikri-0.8.7 lib/krikri/enrichments/strip_html.rb
krikri-0.8.6 lib/krikri/enrichments/strip_html.rb
krikri-0.8.5 lib/krikri/enrichments/strip_html.rb
krikri-0.8.4 lib/krikri/enrichments/strip_html.rb
krikri-0.8.3 lib/krikri/enrichments/strip_html.rb
krikri-0.8.2 lib/krikri/enrichments/strip_html.rb
krikri-0.8.1 lib/krikri/enrichments/strip_html.rb
krikri-0.8.0 lib/krikri/enrichments/strip_html.rb
krikri-0.7.6 lib/krikri/enrichments/strip_html.rb
krikri-0.7.5 lib/krikri/enrichments/strip_html.rb
krikri-0.7.4 lib/krikri/enrichments/strip_html.rb
krikri-0.7.3 lib/krikri/enrichments/strip_html.rb
krikri-0.7.2 lib/krikri/enrichments/strip_html.rb
krikri-0.7.1 lib/krikri/enrichments/strip_html.rb
krikri-0.7.0 lib/krikri/enrichments/strip_html.rb