# File lib/org-ruby/output_buffer.rb, line 60
    def insert(line)
      # Prepares the output buffer to receive content from a line.
      # As a side effect, this may flush the current accumulated text.
      @logger.debug "Looking at #{line.paragraph_type}|#{line.assigned_paragraph_type}(#{current_mode}) : #{line.to_s}"

      # We try to get the lang from #+BEGIN_SRC blocks
      @block_lang = line.block_lang if line.begin_block?
      unless should_accumulate_output?(line)
        flush!
        maintain_mode_stack(line)
      end

      # Adds the current line to the output buffer
      case
      when line.assigned_paragraph_type == :comment
        # Don't add to buffer
      when line.title?
        @buffer << line.output_text
      when line.raw_text?
        @buffer << "\n" << line.output_text if line.raw_text_tag == @buffer_tag
      when preserve_whitespace?
        @buffer << "\n" << line.output_text unless line.block_type
      when line.assigned_paragraph_type == :code
        # If the line is contained within a code block but we should
        # not preserve whitespaces, then we do nothing.
      when (line.kind_of? Headline)
        add_line_attributes line
        @buffer << "\n" << line.output_text.strip
      when ([:definition_term, :list_item, :table_row, :table_header,
             :horizontal_rule].include? line.paragraph_type)
        @buffer << "\n" << line.output_text.strip
      when line.paragraph_type == :paragraph
        @buffer << "\n"
        buffer_indentation
        @buffer << line.output_text.strip
      end

      if mode_is_code? current_mode and not line.block_type
        # Determines the amount of whitespaces to be stripped at the
        # beginning of each line in code block.
        if line.paragraph_type != :blank
          if @code_block_indent
            @code_block_indent = [@code_block_indent, line.indent].min
          else
            @code_block_indent = line.indent
          end
        end
      end

      @output_type = line.assigned_paragraph_type || line.paragraph_type
    end