class Kramdown::Converter::Kramdown
def inner(el, opts = {indent: 0})
def inner(el, opts = {indent: 0}) @stack.push(el) result = +'' el.children.each_with_index do |inner_el, index| options = opts.dup options[:index] = index options[:prev] = (index == 0 ? nil : el.children[index - 1]) options[:pprev] = (index <= 1 ? nil : el.children[index - 2]) options[:next] = (index == el.children.length - 1 ? nil : el.children[index + 1]) options[:nnext] = (index >= el.children.length - 2 ? nil : el.children[index + 2]) result << convert(inner_el, options) end @stack.pop result end