Sha256: b82221a68510a261a80c03b4eca2c192eb26dc263d1b111ecc074f666f3aa0dd

Contents?: true

Size: 347 Bytes

Versions: 6

Compression:

Stored size: 347 Bytes

Contents

# frozen_string_literal: true

module UnescapeHTMLFilter
  # Unescape HTML tags.
  #
  # Example:
  #   <div class="summary">{{payload.test['MESSAGE']['STRING']['$'] | unescape_html}}</div>
  ##
  def unescape_html(input)
    return input if input.blank?
    CGI.unescapeHTML(input)
  end
end

Liquid::Template.register_filter(UnescapeHTMLFilter)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
liquidum-1.2.1 lib/liquidum/liquid/filters/unescape_html_filter.rb
liquidum-1.2.0 lib/liquidum/liquid/filters/unescape_html_filter.rb
liquidum-1.1.2 lib/liquidum/liquid/filters/unescape_html_filter.rb
liquidum-1.1.1 lib/liquidum/liquid/filters/unescape_html_filter.rb
liquidum-1.1.0 lib/liquidum/liquid/filters/unescape_html_filter.rb
liquidum-1.0.22 lib/liquidum/liquid/filters/unescape_html_filter.rb