Skip to content

Commit

Permalink
Quote is required even if it begins with backquote.
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Mar 28, 2024
1 parent 4653a1b commit e8b0e1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}{
Expand Down
2 changes: 1 addition & 1 deletion token/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ func IsNeedQuoted(value string) bool {
}
first := value[0]
switch first {
case '*', '&', '[', '{', '}', ']', ',', '!', '|', '>', '%', '\'', '"', '@', ' ':
case '*', '&', '[', '{', '}', ']', ',', '!', '|', '>', '%', '\'', '"', '@', ' ', '`':
return true
}
last := value[len(value)-1]
Expand Down

0 comments on commit e8b0e1d

Please sign in to comment.