normalize literal newlines in multiline strings

Fixes: https://github.com/kdl-org/kdl/issues/360
This commit is contained in:
Kat Marchán 2024-02-08 11:24:40 -08:00
parent f0f9589636
commit 793a9d4ce7
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
2 changed files with 14 additions and 0 deletions

View File

@ -65,6 +65,8 @@
identifiers.
* `.1`, `+.1` etc are no longer valid identifiers, to prevent confusion and
conflicts with numbers.
* Multi-line strings' literal Newline sequences are now normalized to single
`LF`s.
### KQL

12
SPEC.md
View File

@ -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
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
```kdl