# File lib/org-ruby/parser.rb, line 339
    def to_html
      mark_trees_for_export
      export_options = {
        :decorate_title        => @in_buffer_settings["TITLE"],
        :export_heading_number => export_heading_number?,
        :export_todo           => export_todo?,
        :use_sub_superscripts  => use_sub_superscripts?,
        :export_footnotes      => export_footnotes?,
        :link_abbrevs          => @link_abbrevs,
        :skip_syntax_highlight => @parser_options[:skip_syntax_highlight],
        :markup_file           => @parser_options[:markup_file]
      }
      export_options[:skip_tables] = true if not export_tables?
      output = ""
      output_buffer = HtmlOutputBuffer.new(output, export_options)

      if @in_buffer_settings["TITLE"]

        # If we're given a new title, then just create a new line
        # for that title.
        title = Line.new(@in_buffer_settings["TITLE"], self, :title)
        translate([title], output_buffer)
      end
      translate(@header_lines, output_buffer) unless skip_header_lines?

      # If we've output anything at all, remove the :decorate_title option.
      export_options.delete(:decorate_title) if (output.length > 0)
      @headlines.each do |headline|
        next if headline.export_state == :exclude
        case headline.export_state
        when :exclude
          # NOTHING
        when :headline_only
          translate(headline.body_lines[0, 1], output_buffer)
        when :all
          translate(headline.body_lines, output_buffer)
        end
      end
      output << "\n"

      return output if @parser_options[:skip_rubypants_pass]
        
      rp = RubyPants.new(output) 
      rp.to_html
    end