Skip to content

Preserve comment markers in quoted INI values - #411

Open
rupayon123 wants to merge 1 commit into
go-ini:mainfrom
rupayon123:contribution/quoted-comment-markers-20260923
Open

rupayon123 wants to merge 1 commit into
go-ini:mainfrom
rupayon123:contribution/quoted-comment-markers-20260923

Conversation

@rupayon123

Copy link
Copy Markdown

The INI parser currently truncates single- and double-quoted values at # or ;, so primary = '#e18477' reads back as just a quote (#393). The inline-comment scan runs before the surrounding-quote handling and treats markers inside quotes as comments.

Find inline comment markers only outside quoted text, preserving the existing SpaceBeforeInlineComment rule and leaving apostrophes inside ordinary words alone. Regression tests cover quoted color values, a URL fragment followed by a real comment, ordinary unquoted comments, the space-before option and an apostrophe control. The reproduction failed before the patch; go test -race ./..., go vet ./..., go test -cover ./... (93.7% statement coverage), gofmt and git diff --check pass after on macOS/Go 1.27.1. This is a separate clean branch from #410; it does not include that PR's change.

Prepared with OpenAI Codex assistance on behalf of rupayon123. Remote CI and independent human review are not claimed.

This branch has not been deployed

No deployments
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