# File lib/wikicloth/wiki_buffer/table.rb, line 105
  def new_char()
    if @check_cell_data == 1
      case
      when current_char != '|' && @start_caption == false && (self.rows[-1][-1].nil? || self.rows[-1][-1][:style].blank?)
        self.next_cell() if self.rows[-1][-1].nil?
        self.rows[-1][-1][:style] = self.data
        self.data = ""
      when current_char != '|' && @start_caption == true && self.table_caption_attributes.blank?
        self.table_caption_attributes = self.data
        self.data = ""
      end
      @check_cell_data = 0
    end

    case
    # Next table cell in row (TD)
    when current_char == "|" && (previous_char == "\n" || previous_char == "|") && @in_quotes == false
      self.data.chop! if self.data[-1,1] == "|"
      self.next_cell() unless self.data.blank? && previous_char == "|"
      self.data = ""

    # Next table cell in row (TH)
    when current_char == "!" && (previous_char == "\n" || previous_char == "!") && @in_quotes == false
      self.data.chop!
      self.next_cell('th')
      self.data = ""

    # End of a table
    when current_char == '}' && previous_char == '|'
      self.data = ""
      self.rows[-1].pop
      return false

    # Start table caption
    when current_char == '+' && previous_char == '|' && @in_quotes == false
      self.data = ""
      self.rows[-1].pop
      @start_caption = true

    # Table cell might have attributes
    when current_char == '|' && previous_char != "\n" && @in_quotes == false
      @check_cell_data = 1 unless @start_table

    # End table caption
    when current_char == "\n" && @start_caption == true && @in_quotes == false
      @start_caption = false
      self.table_caption = self.data
      self.data = ""

    # in quotes
    when current_char == '"' && previous_char != '\\'
      @in_quotes = !@in_quotes
      self.data += '"'

    # Table params
    when current_char == "\n" && @start_table == true && @in_quotes == false
      @start_table = false
      unless self.data.blank?
        self.current_param = self.data
        self.params << ""
      end
      self.data = ""

    # Table row params
    when current_char == "\n" && @start_row == true && @in_quotes == false
      @start_row = false
      unless self.data.blank?
        self.current_param = self.data
      end
      self.data = ""

    # Start new table row
    when current_char == '-' && previous_char == '|' && @in_quotes == false
      self.data.chop!
      self.rows[-1].pop
      self.next_row()
      @start_row = true

    else
      self.data << current_char
    end

    return true
  end