Update parsecfg.nim
Value includes double quotation marks.
This commit is contained in:
parent
9a1c87d6bf
commit
89d4574445
1 changed files with 10 additions and 4 deletions
|
|
@ -512,10 +512,16 @@ proc writeConfig*(dict: Config, filename: string) =
|
|||
kv = key
|
||||
if value != "": ## If the key is not empty
|
||||
if not allCharsInSet(value, SymChars):
|
||||
kv.add(segmentChar)
|
||||
kv.add("\"")
|
||||
kv.add(replace(value))
|
||||
kv.add("\"")
|
||||
if find(value, '"') == -1:
|
||||
kv.add(segmentChar)
|
||||
kv.add("\"")
|
||||
kv.add(replace(value))
|
||||
kv.add("\"")
|
||||
else:
|
||||
kv.add(segmentChar)
|
||||
kv.add("\"\"\"")
|
||||
kv.add(replace(value))
|
||||
kv.add("\"\"\"")
|
||||
else:
|
||||
kv.add(segmentChar)
|
||||
kv.add(value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue