Sha256: b1e66ff37f0dd54fd73e5243ec2408b3be6d21e729de8159afff0e260419f3f5

Contents?: true

Size: 396 Bytes

Versions: 11

Compression:

Stored size: 396 Bytes

Contents

module HTML
  class Pipeline
    class TextFilter < Filter
      attr_reader :text

      def initialize(text, context = nil, result = nil)
        raise TypeError, 'text cannot be HTML' if text.is_a?(DocumentFragment)
        # Ensure that this is always a string
        @text = text.respond_to?(:to_str) ? text.to_str : text.to_s
        super nil, context, result
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
html-pipeline-2.11.0 lib/html/pipeline/text_filter.rb
html-pipeline-2.10.0 lib/html/pipeline/text_filter.rb
html-pipeline-2.9.2 lib/html/pipeline/text_filter.rb
html-pipeline-2.9.1 lib/html/pipeline/text_filter.rb
html-pipeline-2.9.0 lib/html/pipeline/text_filter.rb
html-pipeline-2.8.4 lib/html/pipeline/text_filter.rb
html-pipeline-2.8.3 lib/html/pipeline/text_filter.rb
html-pipeline-2.8.2 lib/html/pipeline/text_filter.rb
html-pipeline-2.8.1 lib/html/pipeline/text_filter.rb
html-pipeline-2.8.0 lib/html/pipeline/text_filter.rb
html-pipeline-2.7.2 lib/html/pipeline/text_filter.rb