lib/mastalk.rb in mastalk-0.6.0 vs lib/mastalk.rb in mastalk-0.7.0

- old
+ new

@@ -12,17 +12,19 @@ def initialize(source) @source = source.dup end - def to_html - ::HTMLEntities.new.decode( kramdown.to_html ) + def to_html(options = {}) + options[:auto_id] = options[:auto_id].nil? ? true : options[:auto_id] + ::HTMLEntities.new.decode( kramdown(options).to_html() ) end private - def kramdown - Kramdown::Document.new(preprocess(source)) + def kramdown(options = {}) + options[:auto_id] = options[:auto_id].nil? ? true : options[:auto_id] + Kramdown::Document.new(preprocess(source), :auto_ids => options[:auto_id]) end def preprocess(source) extensions.map do |regex, block| if source.match(regex)