Sha256: 3102900fa2030799ac123706b67e1a6fe79345d5a1f9712caecd42ad8278a010

Contents?: true

Size: 580 Bytes

Versions: 43

Compression:

Stored size: 580 Bytes

Contents

# frozen_string_literal: true

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

    requires 'rdiscount'

    # Runs the content through [RDiscount](http://github.com/rtomayko/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

43 entries across 43 versions & 1 rubygems

Version Path
nanoc-4.11.2 lib/nanoc/filters/rdiscount.rb
nanoc-4.11.1 lib/nanoc/filters/rdiscount.rb
nanoc-4.11.0 lib/nanoc/filters/rdiscount.rb
nanoc-4.10.4 lib/nanoc/filters/rdiscount.rb
nanoc-4.10.3 lib/nanoc/filters/rdiscount.rb
nanoc-4.10.2 lib/nanoc/filters/rdiscount.rb
nanoc-4.10.1 lib/nanoc/filters/rdiscount.rb
nanoc-4.10.0 lib/nanoc/filters/rdiscount.rb
nanoc-4.9.9 lib/nanoc/filters/rdiscount.rb
nanoc-4.9.8 lib/nanoc/filters/rdiscount.rb
nanoc-4.9.7 lib/nanoc/filters/rdiscount.rb
nanoc-4.9.6 lib/nanoc/filters/rdiscount.rb
nanoc-4.9.5 lib/nanoc/filters/rdiscount.rb
nanoc-4.9.4 lib/nanoc/filters/rdiscount.rb
nanoc-4.9.3 lib/nanoc/filters/rdiscount.rb
nanoc-4.9.2 lib/nanoc/filters/rdiscount.rb
nanoc-4.9.1 lib/nanoc/filters/rdiscount.rb
nanoc-4.9.0 lib/nanoc/filters/rdiscount.rb
nanoc-4.8.19 lib/nanoc/filters/rdiscount.rb
nanoc-4.8.18 lib/nanoc/filters/rdiscount.rb