-
Notifications
You must be signed in to change notification settings - Fork 25
Feature request: Allow comments #6
Comments
Hi, Thanks for the feature request, I'm not really sure why you want to parse the comments. If they have valuable information, why don't you make them a variable? Also how can you identify a comment? values have keys and sections but a comment has no key to identify them. |
I think you have mis-understood me. I don't want comments to be parsed. It looks like semi-colon quotes are not supported. Am I missing something? I just want to be able to do something like:
|
Ah yes, i've mis-understood you. Comments are left out of the parsed data, so you can add comments in the .ini file. i've added a test case in the test suite to test for comment parsing. |
I've just tested this again and found there is a bug (which is why I reported this in the first place).
this will produce the json:
it should be:
Thanks for looking at this. Andrew |
Hmm strange, I'm using node 0.4.12 and node-iniparser 1.0.4 and can't reproduce this problem. Can you run this piece of code and tell me what it returns? (example.ini is you piece of ini, you've mentioned earlier and run this code in the root of your git checkout)
What version are you using, and which node version? |
That example you provided worked fine. I've found the issue. It's the blank lines that causes the problem. Try the following example. That will return "undefined" for config.category.key.
|
I know what you mean but if it's a bug, I don't know. based on the article on wikipedia http://en.wikipedia.org/wiki/INI_file, I define the blank line as a break of the section. How can I otherwise determine if the section has ended, double white line? |
Hi again, We've just had an issue with our server admin not realising that double white space lines are not allowed. It's great that you are following the specs so closely, however in this case, this feels like a bug. A section should be indicated by the start of a new [section]. eg.
That would mean it wouldn't be possible to add more keys and values that are not in a section if a section has already been started. I think that's OK since those keys/values should be at the top anyway. What do you think? Thanks for your efforts on this library by the way, it's been really helpful for us. :) Cheers, |
Good point, as more requests are coming in on parsing different types of ini formats, I think it's time to make the parsing more configurable. ie set config flags like allowDoubleWhite:true on the constructor or make different parsing 'engines'. Anyhow it's time to set a standard. |
Thanks for this nice module. I have a little feature request.
Would you be able to add support for comments? I think the standard for .ini file is a semi-colon isn't it?
The text was updated successfully, but these errors were encountered: