-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] #
sign stripped from value
#142
Comments
There are some commits from October 2021, so it seems to be maintained, but the maintainer might be busy with other stuff. Anyway, my use case was simple, so I used regex and removed the |
Mm. I didn't see any non-bot commits in over a year, and the issue you linked to hasn't been commented on despite being opened in 2019. That's what I was thinking, at least. |
You can try my fork, ini-win, which aims to be more compatible with the way Windows handles ini files. Windows only supports whole line comments, and so does my fork, so it fixes this issue. |
Thanks, @m417z, for suggestion, however since I reported this issue I eliminated using a dependency for parsing INI files. 😉 |
This would constitute a breaking change for folks who are relying on the behavior that an unquoted string has and is unlikely to change. If you have values with special characters please escape them or quote them. > ini.decode('key=value\\#value')
[Object: null prototype] { key: 'value#value' }
> ini.decode('key="value#value"')
[Object: null prototype] { key: 'value#value' }
> ini.encode({ key: 'value#value' })
'key=value\\#value\n' |
What / Why
#
sign and everything following it is stripped off.When
Always
Where
How
Current Behavior
Steps to Reproduce
ini.decode('key=value#value')
outputs `{key: 'value'}.Expected Behavior
ini.decode('key=value#value')
should output `{key: 'value#value'}.Alternatively, if you want to strip comments at the end of the lines, strip only everything after
#
(whitespace(s) + hash), but not where there is no space/tab before a comment sign (be it#
or;
).Who
References
Related: #89
The text was updated successfully, but these errors were encountered: