We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
allow_control_characters
1 parent 4808fee commit a5c160fCopy full SHA for a5c160f
lib/json.rb
@@ -173,6 +173,18 @@
173
# When enabled:
174
# JSON.parse('[1,]', allow_trailing_comma: true) # => [1]
175
#
176
+# ---
177
+#
178
+# Option +allow_control_characters+ (boolean) specifies whether to allow
179
+# unescaped ASCII control characters, such as newlines, in strings;
180
+# defaults to +false+.
181
182
+# With the default, +false+:
183
+# JSON.parse(%{"Hello\nWorld"}) # invalid ASCII control character in string (JSON::ParserError)
184
185
+# When enabled:
186
+# JSON.parse(%{"Hello\nWorld"}, allow_control_characters: true) # => "Hello\nWorld"
187
188
# ====== Output Options
189
190
# Option +freeze+ (boolean) specifies whether the returned objects will be frozen;
0 commit comments