Sha256: da069102d4b60f358138a6f05df8b542a6574d2f04bf910e0f5fc254eeeded6f

Contents?: true

Size: 606 Bytes

Versions: 12

Compression:

Stored size: 606 Bytes

Contents

require 'rinku'

module HTML
  class Pipeline
    # HTML Filter for auto_linking urls in HTML.
    #
    # Context options:
    #   :autolink - boolean whether to autolink urls
    #   :flags    - additional Rinku flags. See https://github.com/vmg/rinku
    #
    # This filter does not write additional information to the context.
    class AutolinkFilter < Filter
      def call
        return html if context[:autolink] == false
        flags = 0
        flags |= context[:flags] if context[:flags]

        Rinku.auto_link(html, :urls, nil, %w[a script kbd pre code], flags)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
html-pipeline-0.0.14 lib/html/pipeline/autolink_filter.rb
html-pipeline-0.0.13 lib/html/pipeline/autolink_filter.rb
geothird-html-pipeline-0.0.12 lib/html/pipeline/autolink_filter.rb
html-pipeline-0.0.12 lib/html/pipeline/autolink_filter.rb
html-pipeline-0.0.11 lib/html/pipeline/autolink_filter.rb
html-pipeline-0.0.10 lib/html/pipeline/autolink_filter.rb
html-pipeline-0.0.8 lib/html/pipeline/autolink_filter.rb
html-pipeline-0.0.7 lib/html/pipeline/autolink_filter.rb
html-pipeline-no-charlock-0.0.6 lib/html/pipeline/autolink_filter.rb
html-pipeline-0.0.6 lib/html/pipeline/autolink_filter.rb
html-pipeline-0.0.5 lib/html/pipeline/autolink_filter.rb
html-pipeline-0.0.4 lib/html/pipeline/autolink_filter.rb