Sha256: 362f15f2a9fd629af6a55f5823882e94304f64d68de226c4ea8230c8a9da3ac1

Contents?: true

Size: 383 Bytes

Versions: 11

Compression:

Stored size: 383 Bytes

Contents

# frozen_string_literal: true

HTML::Pipeline.require_dependency('escape_utils', 'PlainTextInputFilter')

module HTML
  class Pipeline
    # Simple filter for plain text input. HTML escapes the text input and wraps it
    # in a div.
    class PlainTextInputFilter < TextFilter
      def call
        "<div>#{EscapeUtils.escape_html(@text, false)}</div>"
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
html-pipeline-2.14.2 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.14.1 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.13.2 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.13.1 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.14.0 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.13.0 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.12.3 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.12.2 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.12.1 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.12.0 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.11.1 lib/html/pipeline/plain_text_input_filter.rb