Skip to content

fix: round-trip section names containing closing brackets - #323

Open
HocVoNgThai wants to merge 1 commit into
npm:mainfrom
HocVoNgThai:fix/section-closing-brackets
Open

HocVoNgThai wants to merge 1 commit into
npm:mainfrom
HocVoNgThai:fix/section-closing-brackets

Conversation

@HocVoNgThai

Copy link
Copy Markdown

Section names containing ] are written by stringify() but rejected as section headers by parse(), so their values become globals when a configuration is saved and read again.

For example, { 'profile]archive': { name: 'sample' } } currently round-trips to { '[profile]archive]': true, name: 'sample' }. Match the final closing bracket of the section header so the original nested object is preserved.

Adds round-trip tests for bracketed and dotted literal section names, plus ordinary-section and assignment controls.

Validation: all six test files pass with 100% coverage, and ESLint passes. The template-oss check fails identically on unchanged main and the patched source due to existing template differences.

Closes #322

@HocVoNgThai
HocVoNgThai requested a review from a team as a code owner October 31, 2026 22:50
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.

[BUG] Section names containing closing brackets do not round-trip

1 participant