Issue #26 resolved

Fixed 88/256 color-codes

Stefan Tatschner
created an issue

Here is the patch.

From ea2935cfda28be49514c685b4e30b87bee7c0835 Mon Sep 17 00:00:00 2001
From: Stefan Tatschner <stefan@sevenbyte.org>
Date: Mon, 31 Mar 2014 17:57:40 +0200
Subject: [PATCH] Fixed 88/256 color-codes

see here: http://misc.flogisoft.com/bash/tip_colors_and_formatting#colors1
---
 tabulate.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tabulate.py b/tabulate.py
index ddd286d..4de2672 100644
--- a/tabulate.py
+++ b/tabulate.py
@@ -190,8 +190,8 @@ _table_formats = {"simple":
 tabulate_formats = list(sorted(_table_formats.keys()))


-_invisible_codes = re.compile("\x1b\[\d*m")  # ANSI color codes
-_invisible_codes_bytes = re.compile(b"\x1b\[\d*m")  # ANSI color codes
+_invisible_codes = re.compile(r"\x1b\[\d*m|\x1b\[\d*\;\d*\;\d*m")  # ANSI color codes
+_invisible_codes_bytes = re.compile(b"\x1b\[\d*m|\x1b\[\d*\;\d*\;\d*m")  # ANSI color codes


 def simple_separated_format(separator):
-- 
1.9.1

Comments (2)

  1. Log in to comment