class Kramdown::Converter::Kramdown
def ial_for_element(el)
def ial_for_element(el) res = el.attr.map do |k,v| next if [:img, :a].include?(el.type) && ['href', 'src', 'alt', 'title'].include?(k) next if el.type == :header && k == 'id' if v.nil? '' elsif k == 'class' " " + v.split(/\s+/).map {|w| ".#{w}"}.join(" ") elsif k == 'id' " ##{v}" else " #{k}=\"#{v.to_s}\"" end end.compact.join('') res = "toc" + (res.strip.empty? ? '' : " #{res}") if (el.type == :ul || el.type == :ol) && (el.options[:ial][:refs].include?('toc') rescue nil) res.strip.empty? ? nil : "{:#{res}}" end