aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/utils/irc.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/utils/irc.py b/src/utils/irc.py
index f3b692a3..af30c6fd 100644
--- a/src/utils/irc.py
+++ b/src/utils/irc.py
@@ -162,11 +162,16 @@ def _color_tokens(s: str) -> typing.List[str]:
else:
foreground += char
continue
- elif char == ",":
+ elif char == "," and not background:
background += char
continue
else:
- matches.append("\x03%s%s" % (foreground, background))
+ color = foreground
+ if len(background) > 1:
+ color += background
+
+ if color:
+ matches.append("\x03%s" % color)
is_color = False
foreground = ""
background = ""