diff --git a/encode_test.go b/encode_test.go index 3ff6f1c1..31bd6fec 100644 --- a/encode_test.go +++ b/encode_test.go @@ -318,6 +318,11 @@ func TestEncoder(t *testing.T) { map[string]string{"a": " b "}, nil, }, + { + "a: \"`b` c\"\n", + map[string]string{"a": "`b` c"}, + nil, + }, { "a: 100.5\n", map[string]interface{}{ diff --git a/token/token.go b/token/token.go index c86caab2..14d76220 100644 --- a/token/token.go +++ b/token/token.go @@ -623,7 +623,7 @@ func IsNeedQuoted(value string) bool { } first := value[0] switch first { - case '*', '&', '[', '{', '}', ']', ',', '!', '|', '>', '%', '\'', '"', '@', ' ': + case '*', '&', '[', '{', '}', ']', ',', '!', '|', '>', '%', '\'', '"', '@', ' ', '`': return true } last := value[len(value)-1]