diff --git a/encode_test.go b/encode_test.go index 9ca44040..74388b98 100644 --- a/encode_test.go +++ b/encode_test.go @@ -338,6 +338,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]