class Jekyll::Converters::SmartyPants

Public Class Methods

new(config) click to toggle source
# File lib/jekyll/converters/smartypants.rb, line 22
def initialize(config)
  unless defined?(Kramdown)
    Jekyll::External.require_with_graceful_fail "kramdown"
  end
  @config = config["kramdown"].dup || {}
  @config[:input] = :SmartyPants
end

Public Instance Methods

convert(content) click to toggle source
# File lib/jekyll/converters/smartypants.rb, line 38
def convert(content)
  document = Kramdown::Document.new(content, @config)
  html_output = document.to_html.chomp
  if @config["show_warnings"]
    document.warnings.each do |warning|
      Jekyll.logger.warn "Kramdown warning:", warning.sub(%r!^Warning:\s+!, "")
    end
  end
  html_output
end
matches(_) click to toggle source
# File lib/jekyll/converters/smartypants.rb, line 30
def matches(_)
  false
end
output_ext(_) click to toggle source
# File lib/jekyll/converters/smartypants.rb, line 34
def output_ext(_)
  nil
end