Sha256: 37c6b1fc4d02d48e3753ad2511045c99d0fb397918e848ef2f8b443ceb2b70fe
Contents?: true
Size: 951 Bytes
Versions: 10
Compression:
Stored size: 951 Bytes
Contents
module Nanoc::Filters # @api private class Kramdown < Nanoc::Filter requires 'kramdown' # Runs the content through [Kramdown](http://kramdown.gettalong.org/). # Parameters passed to this filter will be passed on to Kramdown. # # @param [String] content The content to filter # # @return [String] The filtered content def run(content, params = {}) params = params.dup warning_filters = params.delete(:warning_filters) document = ::Kramdown::Document.new(content, params) if warning_filters r = Regexp.union(warning_filters) warnings = document.warnings.reject { |warning| r =~ warning } else warnings = document.warnings end if warnings.any? $stderr.puts "kramdown warning(s) for #{@item_rep.inspect}" warnings.each do |warning| $stderr.puts " #{warning}" end end document.to_html end end end
Version data entries
10 entries across 10 versions & 1 rubygems