class Kramdown::Converter::Kramdown

def convert_html_element(el, opts)

def convert_html_element(el, opts)
  markdown_attr = el.options[:category] == :block && el.children.any? do |c|
    c.type != :html_element && (c.type != :p || !c.options[:transparent]) && Element.category(c) == :block
  end
  opts[:force_raw_text] = true if %w{script pre code}.include?(el.value)
  opts[:raw_text] = opts[:force_raw_text] || opts[:block_raw_text] || (el.options[:category] != :span && !markdown_attr)
  opts[:block_raw_text] = true if el.options[:category] == :block && opts[:raw_text]
  res = inner(el, opts)
  if el.options[:category] == :span
    "<#{el.value}#{html_attributes(el.attr)}" << (!res.empty? || HTML_TAGS_WITH_BODY.include?(el.value) ? ">#{res}</#{el.value}>" : " />")
  else
    output = ''
    attr = el.attr.dup
    attr['markdown'] = '1' if markdown_attr
    output << "<#{el.value}#{html_attributes(attr)}"
    if !res.empty? && el.options[:content_model] != :block
      output << ">#{res}</#{el.value}>"
    elsif !res.empty?
      output << ">\n#{res}"  <<  "</#{el.value}>"
    elsif HTML_TAGS_WITH_BODY.include?(el.value)
      output << "></#{el.value}>"
    else
      output << " />"
    end
    output << "\n" if @stack.last.type != :html_element || @stack.last.options[:content_model] != :raw
    output
  end
end