Skip to content

fix(lexers): keep Java properties separate after escaped backslashes - #1511

Merged
github-actions[bot] merged 1 commit into
alecthomas:masterfrom
yxshee:fix/properties-value-continuation-nov19
Nov 19, 2026
Merged

github-actions[bot] merged 1 commit into
alecthomas:masterfrom
yxshee:fix/properties-value-continuation-nov19

Conversation

@yxshee

@yxshee yxshee commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

The Java properties lexer considers a trailing \ to mean continuation of the value on the following line. In this file written by Properties.store, all of zulu=ok would be highlighted by Chroma as belonging to alpha.

alpha=C\:\\
zulu=ok

The lexer now consumes backslashes in pairs with the following character, so only an odd number of trailing backslashes will continue to the next line. There are examples using = and spaces as the key-value separator.

--- FAIL: TestLexers/properties/testdata/properties.actual

Ran bit -f test, bit -f lint, bit -f check-generated and go test -count=1 ./....

@github-actions
github-actions Bot enabled auto-merge (squash) November 19, 2026 11:06
@github-actions
github-actions Bot merged commit 9609217 into alecthomas:master Nov 19, 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.

1 participant