class CodeRay::Encoders::Terminal

def text_token text, kind

def text_token text, kind
  if color = (@subcolors || TOKEN_COLORS)[kind]
    if Hash === color
      if color[:self]
        color = color[:self]
      else
        @out << text
        return
      end
    end
    
    @out << ansi_colorize(color)
    @out << text.gsub("\n", ansi_clear + "\n" + ansi_colorize(color))
    @out << ansi_clear
    @out << ansi_colorize(@subcolors[:self]) if @subcolors && @subcolors[:self]
  else
    @out << text
  end
end