From f4371f16fd9ba9bffdd32a877b32f78222aef87c Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Sun, 22 Jul 2012 09:25:15 +0200 Subject: [PATCH 3/3] The 0 control code could be at the end of a sequence Example: u"\x1b[32;01m * \x1b[39;49;00m *" Note that here 39 and 49 "reset to default" codes are still not handled. --- ansi2html/converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansi2html/converter.py b/ansi2html/converter.py index 0609a9e..23be2d0 100755 --- a/ansi2html/converter.py +++ b/ansi2html/converter.py @@ -147,7 +147,7 @@ class Ansi2HTMLConverter(object): if params[0] in [38, 48]: params = ["%i-%i" % (params[0], params[2])] + params[3:] - if params == [0]: + if 0 in params: # If the control code 0 is present, close all tags we've # opened so far. i.e. reset all attributes yield '' * n_open -- 1.7.9.5