Skip to content

fix(lexers): keep escaped separators in Java properties keys - #1517

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

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

Conversation

@yxshee

@yxshee yxshee commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Properties.store outputs the following for a key profile:prod region. Chroma stops at the escaped colon, treating everything after this as the value.

profile\:prod\ region=active

The lexer now finds the first non-escaped space or other separator character. Any number of spaces and separators may therefore be escaped within the key name, even when the key continues on the following line. Zero-length keys and keys containing punctuation with no assigned value are also recognized.

The regression fixture gave Found Error token in lexer properties output when run against master. The keys and values identified by the lexer matched the JDK implementation on 1,681 inputs. All 51 properties files from Maven libraries produced unchanged output. All tests, lints and checks on generated files pass under Go.

@github-actions
github-actions Bot enabled auto-merge (squash) November 19, 2026 12:22
@github-actions
github-actions Bot merged commit 547de11 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