Skip to content

Commit da3f728

Browse files
authored
Bot: Handle iphone style quotes (#182)
1 parent de3049b commit da3f728

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

bot/extras/shellwords/shellwords.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ func Parse(line string) ([]string, error) {
7676
}
7777

7878
switch r {
79-
case '"':
79+
case '"', '“', '”':
8080
if !singleQuoted {
8181
if doubleQuoted {
8282
got = true
8383
}
8484
doubleQuoted = !doubleQuoted
8585
continue
8686
}
87-
case '\'', '`':
87+
case '\'', '`', '‘', '’':
8888
if !doubleQuoted {
8989
if singleQuoted {
9090
got = true

bot/extras/shellwords/shellwords_test.go

+10
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ func TestParse(t *testing.T) {
5858
[]string{"this", "should", "not", "crash"},
5959
true,
6060
},
61+
{
62+
"iPhone “double quoted” text",
63+
[]string{"iPhone", "double quoted", "text"},
64+
true,
65+
},
66+
{
67+
"iPhone ‘single quoted’ text",
68+
[]string{"iPhone", "single quoted", "text"},
69+
true,
70+
},
6171
}
6272

6373
for _, test := range tests {

0 commit comments

Comments
 (0)