Sha256: 168fa705f0120c6b502e26c239f95c11772b786cd4d472c3fd3d232136605619

Contents?: true

Size: 395 Bytes

Versions: 83

Compression:

Stored size: 395 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

83 entries across 83 versions & 4 rubygems

Version Path
html-pipeline-linuxfr-0.15.7 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.15.6 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.15.5 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.15.4 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.15.3 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.14.30 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.15.2 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.15.1 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.14.29 lib/html/pipeline/text_filter.rb
html-pipeline-2.7.1 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.15.0 lib/html/pipeline/text_filter.rb
html-pipeline-2.7.0 lib/html/pipeline/text_filter.rb
html-pipeline-2.6.0 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.14.28 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.14.27 lib/html/pipeline/text_filter.rb
html-pipeline-2.5.0 lib/html/pipeline/text_filter.rb
html-pipeline-linuxfr-0.14.26 lib/html/pipeline/text_filter.rb
html-pipeline-2.4.2 lib/html/pipeline/text_filter.rb
html-pipeline-2.4.1 lib/html/pipeline/text_filter.rb
html-pipeline-2.4.0 lib/html/pipeline/text_filter.rb