npm / ini

An ini parser/serializer in JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] `#` sign stripped from value

tukusejssirs opened this issue · comments

What / Why

# sign and everything following it is stripped off.

When

Always

Where

  • n/a

How

Current Behavior

  • n/a

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

  • n/a

References

  • n/a

Related: #89

but not where there is no space/tab before a comment sign (be it # or ;).

That's not my expectation.

I think to get the desired behavior you would have to do ini.decode('key="value#value"'), and for issue #89 to be resolved.

Either way, this project looks abandoned. Maybe @isaacs can confirm.

Either way, this project looks abandoned. Maybe @isaacs can confirm.

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 ini dependency. This issue is a deal breaker for me.

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. 😉