Skip to content

Commit 82cb31e

Browse files
committed
Revert "grammars : don't allow to output unescaped new line in string (ggml-org#5885)"
This reverts commit b1a4e99.
1 parent b1a4e99 commit 82cb31e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

grammars/json.gbnf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ array ::=
1515

1616
string ::=
1717
"\"" (
18-
[^"\\\n] |
18+
[^"\\] |
1919
"\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
2020
)* "\"" ws
2121

grammars/json_arr.gbnf

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ array ::=
2424

2525
string ::=
2626
"\"" (
27-
[^"\\\n] |
27+
[^"\\] |
2828
"\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
2929
)* "\"" ws
3030

0 commit comments

Comments
 (0)