Sha256: 8d922e9432c5267198de5cdbe6b863eb1058bea57a825e145d576a16f8c1f43c

Contents?: true

Size: 907 Bytes

Versions: 1

Compression:

Stored size: 907 Bytes

Contents

begin
  require "redcloth"
rescue LoadError => _
  raise MissingDependencyError, "Missing dependency 'RedCloth' for TextileFilter. See README.md for details."
end

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

1 entries across 1 versions & 1 rubygems

Version Path
html-pipeline-2.2.3 lib/html/pipeline/textile_filter.rb