Open davidhalter opened 3 weeks ago
I would prefer to add a new field in ParseOption
to support this kind of behavior.
PRs are welcome.
I have a busy 2 weeks in front of me, but I'm happy to do it afterwards.
Also: Isn't the current behavior broken in a way? Do we really want multi-line keys?
Well, the current behavior about parsing key
is: read until we found character =
or :
.
We don't want multi-line keys. It should be fixed.
Python's configparser allows to parse these multiline sections and will have a value of
'\nb\nc'
forfoo
:I would like to parse this as well with
rust-ini
. However currently this fully ignoressection2
and leads to this:In my opinion this is very weird and should probably never be the case. Here it seems that the key becomes something very long that even "eats" the next section. At the very least I feel like this should not be a valid key. I personally would like to change the current behavior to parse these multiline inis. Would a PR be accepted? I'm happy to do the work. Otherwise I would probably just fork. Do you think we need a feature flag for this like
multiline-values
? I feel like the current behavior doesn't really help anybody either.If someone is interested, this is how you do it in Python: