Skip to content

Commit

Permalink
Fix for ANSI color codes that include blank values (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysonlarose authored Jul 7, 2022
1 parent 62d113b commit b4224cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ansi2html/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,13 @@ def _handle_ansi_code(
yield CursorMoveUp()
continue

while True:
param_len = len(params)
params = params.replace("::", ":")
params = params.replace(";;", ";")
if len(params) == param_len:
break

try:
params = [int(x) for x in re.split("[;:]", params)]
except ValueError:
Expand Down

0 comments on commit b4224cd

Please sign in to comment.