Skip to content

fix: preserve comment characters inside quoted values - #413

Closed
AdamMagued wants to merge 1 commit into
go-ini:mainfrom
AdamMagued:fix-inline-comment-inside-quotes
Closed

AdamMagued wants to merge 1 commit into
go-ini:mainfrom
AdamMagued:fix-inline-comment-inside-quotes

Conversation

@AdamMagued

Copy link
Copy Markdown

When parsing key-value pairs, inline comment scanning previously stripped # or ; delimiters even when they appeared inside single or double quoted strings (e.g. '#e18477'). As a result, the remainder of the quoted string was dropped and stored as an inline comment, leaving an incomplete value.

This change updates inline comment scanning to skip comment delimiters that occur inside matched quotes (' or "), preserving comment symbols within quoted values while retaining proper stripping of trailing inline comments outside quotes.

Fixes #393

@AdamMagued

Copy link
Copy Markdown
Author

Closing in favor of earlier community PRs #394 and #411 to keep the review queue clean.

@AdamMagued AdamMagued closed this Oct 2, 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

1 participant