Sha256: ebf5ffd13a2298fcdd5ab8d2d7bd63e432d25bcf47670ab38cd397876e24c6bc

Contents?: true

Size: 833 Bytes

Versions: 12

Compression:

Stored size: 833 Bytes

Contents

# frozen_string_literal: true

HTML::Pipeline.require_dependency('redcloth', 'RedCloth')

module HTML
  class Pipeline
    # HTML Filter that converts Textile text into HTML and converts into a
    # DocumentFragment. This is different from most filters in that it can take a
    # non-HTML as input. It must be used as the first filter in a pipeline.
    #
    # Context options:
    #   :autolink => false    Disable autolinking URLs
    #
    # This filter does not write any additional information to the context hash.
    #
    # NOTE This filter is provided for really old comments only. It probably
    # shouldn't be used for anything new.
    class TextileFilter < TextFilter
      # Convert Textile to HTML and convert into a DocumentFragment.
      def call
        RedCloth.new(@text).to_html
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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