class Kramdown::Parser::Html::ElementConverter

def remove_whitespace_children(el)

def remove_whitespace_children(el)
  i = -1
  el.children = el.children.reject do |c|
    i += 1
    c.type == :text && c.value.strip.empty? &&
      (i == 0 || i == el.children.length - 1 || (Element.category(el.children[i-1]) == :block &&
                                                 Element.category(el.children[i+1]) == :block))
  end
end