diff options
| author | 2018-11-14 22:35:13 +0000 | |
|---|---|---|
| committer | 2018-11-14 22:35:13 +0000 | |
| commit | 2fc948ab240cf2e1128fcd34685329855b4f1750 (patch) | |
| tree | c8ea249b0bc6b23d1f16c13b2cfee337d0726760 /src | |
| parent | This `elif` should have actually been one even indented! (diff) | |
| signature | ||
Don't eat commas when there's no background color or when a comma directly
follows a background color
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils/irc.py | 9 |
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 = "" |
