Skip to content

Preserve comment markers inside quoted values - #414

Merged
unknwon merged 1 commit into
go-ini:v1from
rupayon123:fix/quoted-inline-comments-20261002
Nov 11, 2026
Merged

unknwon merged 1 commit into
go-ini:v1from
rupayon123:fix/quoted-inline-comments-20261002

Conversation

@rupayon123

@rupayon123 rupayon123 commented Oct 3, 2026 •

Copy link
Copy Markdown

Summary

Do not treat # or ; inside a surrounding single- or double-quoted value as an inline comment. A marker after the closing quote still starts the comment, and the parsed key retains the quoted value without its delimiters.

Fixes #393.

Validation

  • Added a regression covering single quotes, double quotes, and an inline comment after a closing quote. The test failed before the fix and passes after it.
  • go test ./... -count=1 passed.
  • go vet ./... and git diff --check passed.

@unknwon
unknwon force-pushed the fix/quoted-inline-comments-20261002 branch from d6a02d6 to 2bec834 Compare November 11, 2026 20:03
@unknwon
unknwon merged commit 9772c34 into go-ini:v1 Nov 11, 2026
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.

value parsed incorrectly when a comment symbol (#) is inside a quoted string

2 participants