Sha256: 554dfe93ce3cca6f12fbd581aaf466b22f6e9da50b4eeb7a1804984a9c40a6b9

Contents?: true

Size: 582 Bytes

Versions: 47

Compression:

Stored size: 582 Bytes

Contents

# frozen_string_literal: true

module Nanoc::Filters
  # @api private
  class RDiscount < Nanoc::Filter
    identifier :rdiscount

    requires 'rdiscount'

    # Runs the content through [RDiscount](https://github.com/davidfstr/rdiscount).
    #
    # @option params [Array] :extensions ([]) A list of RDiscount extensions
    #
    # @param [String] content The content to filter
    #
    # @return [String] The filtered content
    def run(content, params = {})
      extensions = params[:extensions] || []

      ::RDiscount.new(content, *extensions).to_html
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
nanoc-4.13.3 lib/nanoc/filters/rdiscount.rb
nanoc-4.13.2 lib/nanoc/filters/rdiscount.rb
nanoc-4.13.1 lib/nanoc/filters/rdiscount.rb
nanoc-4.13.0 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.21 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.20 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.19 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.18 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.17 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.16 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.15 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.14 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.13 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.12 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.11 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.10 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.9 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.8 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.7 lib/nanoc/filters/rdiscount.rb
nanoc-4.12.6 lib/nanoc/filters/rdiscount.rb