diff options
| author | 2019-01-13 01:54:02 +0000 | |
|---|---|---|
| committer | 2019-01-13 01:54:02 +0000 | |
| commit | 97b7249989980510a8a99636e3e679e4d7c2b25f (patch) | |
| tree | ea06a6cd0cf4574f173af7e1ae00fc955af0f5c7 /src/utils | |
| parent | Only show issue comment edit events when the body text of the comment has (diff) | |
| signature | ||
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)
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/irc.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/utils/irc.py b/src/utils/irc.py index e2b2cf19..1cfe4fcc 100644 --- a/src/utils/irc.py +++ b/src/utils/irc.py @@ -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: |
