ini icon indicating copy to clipboard operation
ini copied to clipboard

add NoMultiLineSurroundingQuotes option

Open benbaker76 opened this issue 1 year ago • 0 comments

Describe the pull request

Consider the following multi-line ini file:

value1 = some text here
	some more text here 2

Run the following code:

path := "multiline_eof.ini"
f, _ := ini.LoadSources(ini.LoadOptions{
  AllowPythonMultilineValues: true,
}, path)

f.Section("").Key("value1").SetValue("some text here\n\tsome more text here 2")
f.SaveTo(path)

Will output:

value1 = """some text here
	some more text here 2"""

Now run:

path := "multiline_eof.ini"
f, _ := ini.LoadSources(ini.LoadOptions{
  AllowPythonMultilineValues: true,
  NoMultiLineSurroundingQuotes: true,
}, path)

f.Section("").Key("value1").SetValue("some text here\n\tsome more text here 2")
f.SaveTo(path)

The output is the same as the original file

value1 = some text here
	some more text here 2

Link to the issue: n/a

Checklist

  • [*] I agree to follow the Code of Conduct by submitting this pull request.
  • [*] I have read and acknowledge the Contributing guide.
  • [*] I have added test cases to cover the new code.

benbaker76 avatar Nov 11 '22 03:11 benbaker76