Skip to content

Commit b4224cd

Browse files
authored
Fix for ANSI color codes that include blank values (#178)
1 parent 62d113b commit b4224cd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ansi2html/converter.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,13 @@ def _handle_ansi_code(
454454
yield CursorMoveUp()
455455
continue
456456

457+
while True:
458+
param_len = len(params)
459+
params = params.replace("::", ":")
460+
params = params.replace(";;", ";")
461+
if len(params) == param_len:
462+
break
463+
457464
try:
458465
params = [int(x) for x in re.split("[;:]", params)]
459466
except ValueError:

0 commit comments

Comments
 (0)