mirror of https://github.com/kdl-org/kdl.git
normalize literal newlines in multiline strings
Fixes: https://github.com/kdl-org/kdl/issues/360
This commit is contained in:
parent
f0f9589636
commit
793a9d4ce7
|
|
@ -65,6 +65,8 @@
|
||||||
identifiers.
|
identifiers.
|
||||||
* `.1`, `+.1` etc are no longer valid identifiers, to prevent confusion and
|
* `.1`, `+.1` etc are no longer valid identifiers, to prevent confusion and
|
||||||
conflicts with numbers.
|
conflicts with numbers.
|
||||||
|
* Multi-line strings' literal Newline sequences are now normalized to single
|
||||||
|
`LF`s.
|
||||||
|
|
||||||
### KQL
|
### KQL
|
||||||
|
|
||||||
|
|
|
||||||
12
SPEC.md
12
SPEC.md
|
|
@ -463,6 +463,18 @@ removed from all other lines.
|
||||||
It is a syntax error for any body lines of the multi-line string to not match
|
It is a syntax error for any body lines of the multi-line string to not match
|
||||||
the whitespace prefix of the last line with the final quote.
|
the whitespace prefix of the last line with the final quote.
|
||||||
|
|
||||||
|
#### Newline Normalization
|
||||||
|
|
||||||
|
Literal Newline sequences in Multi-line Strings must be normalized to a single
|
||||||
|
`U+000A` (`LF`) during deserialization. This means, for example, that `CR LF`
|
||||||
|
becomes a single `LF` during parsing.
|
||||||
|
|
||||||
|
This normalization does not apply to non-literal Newlines entered using escape
|
||||||
|
sequences.
|
||||||
|
|
||||||
|
For clarity: this normalization is for individual sequences. That is, the
|
||||||
|
literal sequence `CRLF CRLF` becomes `LF LF`, not `LF`.
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```kdl
|
```kdl
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue