Skip to content

fix(formatters): preserve leading commas after IRC foreground colors - #1514

Merged
alecthomas merged 1 commit into
alecthomas:masterfrom
yxshee:fix/mirc-preserve-leading-comma-nov19
Nov 21, 2026
Merged

alecthomas merged 1 commit into
alecthomas:masterfrom
yxshee:fix/mirc-preserve-leading-comma-nov19

Conversation

@yxshee

@yxshee yxshee commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

The Lounge will show ,units in this case, that is, take the initial ,13 to mean a background color. With mirc16m, the same happens for a foreground color followed by , and six hex digits, such as at the start of a line in a multi-line Python string.

quick.Highlight(os.Stdout, ",13,units", "plaintext", "mirc100", "monokai")

Both formatters add two bold toggles when the leading comma and digits could be read as a background color. The text stays visible with its original style.

The regression fails on master with FAIL: TestIRCLeadingComma/indexed. On the fix, the IRC tests, all Go tests, lint and the generated-file check pass.

@alecthomas
alecthomas merged commit 7839395 into alecthomas:master Nov 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants