fix(encode): fall back from the literal multiline form when unsafe
Assisted-by: GLM 5.3
This commit is contained in:
+4
-1
@@ -351,7 +351,10 @@ out, err := interpres.NewEncoder().UseLiteralMultiline(80).Marshal(cfg)
|
||||
```
|
||||
|
||||
Single-line strings keep the basic form regardless of the threshold, and a
|
||||
threshold of `0` or less disables the option.
|
||||
threshold of `0` or less disables the option. A string the literal form cannot
|
||||
carry verbatim (an embedded run of three single quotes, a control character
|
||||
other than tab, or a carriage return outside a CRLF pair) also keeps the basic
|
||||
form, so the output always re-parses to the same value.
|
||||
|
||||
### Cancellation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user