Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ func (p *parser) readValue(in []byte, ignoreContinuation, ignoreInlineComment bo
var valQuote string
if len(line) > 3 && string(line[0:3]) == `"""` {
valQuote = `"""`
} else if line[0] == '"' {
valQuote = `"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://github.com/go-ini/ini#working-with-values:

image

So this won't be supported as default behavior.

} else if line[0] == '`' {
valQuote = "`"
}
Expand All @@ -213,6 +215,9 @@ func (p *parser) readValue(in []byte, ignoreContinuation, ignoreInlineComment bo
if pos == -1 {
return p.readMultilines(line, line[startIdx:], valQuote)
}
if valQuote == `"` {
return strings.Replace(line[startIdx:pos+startIdx], `\"`, `"`, -1), nil

@unknwon unknwon Aug 13, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you distinguish user actually wants \" instead of replacing them to "?

}

return line[startIdx : pos+startIdx], nil
}
Expand Down