Class: HTMLPipeline::TextFilter::PlainTextInputFilter

Inherits:
HTMLPipeline::TextFilter show all
Defined in:
lib/html_pipeline/text_filter/plain_text_input_filter.rb

Overview

Simple filter for plain text input. HTML escapes the text input and wraps it in a div.

Instance Attribute Summary

Attributes inherited from HTMLPipeline::TextFilter

#text

Attributes inherited from Filter

#context, #result

Instance Method Summary collapse

Methods inherited from HTMLPipeline::TextFilter

call, #initialize

Methods inherited from Filter

#base_url, call, #has_ancestor?, #initialize, #needs, #validate

Constructor Details

This class inherits a constructor from HTMLPipeline::TextFilter

Instance Method Details

#call(text, context: {}, result: {}) ⇒ Object



8
9
10
# File 'lib/html_pipeline/text_filter/plain_text_input_filter.rb', line 8

def call(text, context: {}, result: {})
  "<div>#{CGI.escapeHTML(text)}</div>"
end