Sha256: b0400e2ab973b792df0ad9f42d0bb11f4ccc96aecdf1cb852d69d7c9b0b78da7

Contents?: true

Size: 331 Bytes

Versions: 3

Compression:

Stored size: 331 Bytes

Contents

# frozen_string_literal: true

class HTMLPipeline
  class TextFilter
    # Simple filter for plain text input. HTML escapes the text input and wraps it
    # in a div.
    class PlainTextInputFilter < TextFilter
      def call(text, context: {}, result: {})
        "<div>#{CGI.escapeHTML(text)}</div>"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
html-pipeline-3.2.1 lib/html_pipeline/text_filter/plain_text_input_filter.rb
html-pipeline-3.2.0 lib/html_pipeline/text_filter/plain_text_input_filter.rb
html-pipeline-3.1.1 lib/html_pipeline/text_filter/plain_text_input_filter.rb