From 90b51cfd0f5b613b42f4a7184e24edc90ff4f300 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 2 Jul 2017 12:36:22 +0800 Subject: [PATCH] add support for double quote on item value --- parser.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parser.go b/parser.go index 69d5476..6a5638d 100644 --- a/parser.go +++ b/parser.go @@ -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 = `"` } else if line[0] == '`' { valQuote = "`" } @@ -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 + } return line[startIdx : pos+startIdx], nil }