Open kixorz opened 9 years ago
There doesn't seem to be any "official" spec just what's popular in implementations... and git is one example that does permit same-line comments: https://git-scm.com/docs/git-config
Maybe an extra parse option is called for?
Extra parsing option would work!
so funny enough I had a similar need but for Zend booleans, I already have a pr with tests, but @isaacs hasn't commented yet. https://github.com/npm/ini/pull/50
It would be easy to add another decode filter, but may take some screwing around since it changes things a bit
i found this issue too. I have values containig html entities. Worked fine in Python... And it was also fixed in PHP (https://bugs.php.net/bug.php?id=51094). Extra parsing option could fix this.
2k20 still needed thanks to 3dx and such - putting path arrays with semicolons in values... For those who don't want to waste time searching solution: https://www.npmjs.com/package/js-ini
I have the same issue with ; and # both. The WinAPI does not allow comments in the key portion, so these characters are treated as part of the key's value. See https://en.wikipedia.org/wiki/INI_file#Comments_2 for reference.
As stated above, parsing of ; and # in keys should be an option, not mandatory. I ended up forking the code for this reason, and ripped out the key comment processing bits.
(I also converted it to Typescript for easier inclusion in a React-TS app)
Ini spec only allows semicolons to be interpreted as comments when they are in the beginning of the line.
; comment
I'm experiencing bug when parsing the following keypair:key=value;value;value
value;value;value
should be interpreted as a string and instead it's parsed only asvalue
and rest is ignored.Thanks for considering a fix!