Sha256: d3d23a5870f5774b1402ca9ebb060476fa12c94941096cc0231801931a3207fc

Contents?: true

Size: 472 Bytes

Versions: 8

Compression:

Stored size: 472 Bytes

Contents

begin
  require "escape_utils"
rescue LoadError => _
  raise HTML::Pipeline::MissingDependencyError, "Missing dependency 'escape_utils' for PlainTextInputFilter. See README.md for details."
end

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

8 entries across 8 versions & 1 rubygems

Version Path
html-pipeline-2.7.0 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.6.0 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.5.0 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.4.2 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.4.1 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.4.0 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.3.0 lib/html/pipeline/plain_text_input_filter.rb
html-pipeline-2.2.4 lib/html/pipeline/plain_text_input_filter.rb