class Kramdown::Parser::Html::ElementConverter
def process(el, do_conversion = true, preserve_text = false, parent = nil)
def process(el, do_conversion = true, preserve_text = false, parent = nil) case el.type when :xml_comment, :xml_pi ptype = if parent.nil? 'div' else case parent.type when :html_element then parent.value when :code_span then 'code' when :code_block then 'pre' when :header then 'h1' else parent.type.to_s end end el.options.replace({:category => (HTML_CONTENT_MODEL[ptype] == :span ? :span : :block)}) return when :html_element when :root el.children.each {|c| process(c)} remove_whitespace_children(el) return else return end mname = "convert_#{el.value}" if do_conversion && self.class.method_defined?(mname) send(mname, el) else type = el.value remove_text_children(el) if do_conversion && REMOVE_TEXT_CHILDREN.include?(type) if do_conversion && SIMPLE_ELEMENTS.include?(type) set_basics(el, type.intern) process_children(el, do_conversion, preserve_text) else process_html_element(el, do_conversion, preserve_text) end if do_conversion strip_whitespace(el) if STRIP_WHITESPACE.include?(type) remove_whitespace_children(el) if REMOVE_WHITESPACE_CHILDREN.include?(type) wrap_text_children(el) if WRAP_TEXT_CHILDREN.include?(type) end end end