don't consume 3 digits for a colour code when the first char is 0 and the second
two chars make up a valid colour code (src.utils.irc)
This commit is contained in:
parent
9ab9400b46
commit
97b7249989
1 changed files with 5 additions and 3 deletions
|
@ -159,12 +159,14 @@ def _color_tokens(s: str) -> typing.List[str]:
|
|||
|
||||
for char in s:
|
||||
if is_color:
|
||||
can_add = char.isdigit()
|
||||
if can_add:
|
||||
current_color = background if is_background else foreground
|
||||
can_add = False
|
||||
current_color = background if is_background else foreground
|
||||
if char.isdigit() and len(current_color) < 2:
|
||||
if current_color:
|
||||
next_color = int(current_color + char)
|
||||
can_add = next_color <= 15 or next_color == 99
|
||||
else:
|
||||
can_add = True
|
||||
|
||||
if can_add:
|
||||
if is_background:
|
||||
|
|
Loading…
Reference in a new issue