mirror of https://github.com/kdl-org/kdl.git
Clarify how whitespace escapes work in multi-line strings
One example in the spec and two test cases appeared to contradict the language of the spec
This commit is contained in:
parent
6a77436e09
commit
cc6b7708c0
13
SPEC.md
13
SPEC.md
|
|
@ -386,8 +386,10 @@ such) are retained. For example, these strings are all semantically identical:
|
|||
```kdl
|
||||
"Hello\ \nWorld"
|
||||
|
||||
"Hello\n\
|
||||
World"
|
||||
"
|
||||
Hello\n\
|
||||
World
|
||||
"
|
||||
|
||||
"Hello\nWorld"
|
||||
|
||||
|
|
@ -437,10 +439,9 @@ The string contains the literal characters `hello\n\r\asd"#world`
|
|||
|
||||
### Multi-line Strings
|
||||
|
||||
When a Quoted or Raw String spans multiple lines with literal, non-escaped
|
||||
Newlines, it follows a special multi-line syntax that automatically "dedents"
|
||||
the string, allowing its value to be indented to a visually matching level if
|
||||
desired.
|
||||
When a Quoted or Raw String spans multiple lines with literal Newlines, it
|
||||
follows a special multi-line syntax that automatically "dedents" the string,
|
||||
allowing its value to be indented to a visually matching level if desired.
|
||||
|
||||
A Multi-line string _MUST_ start with a [Newline](#newline) immediately
|
||||
following its opening `"`. Its final line _MUST_ contain only whitespace,
|
||||
|
|
|
|||
|
|
@ -6,10 +6,14 @@ node \
|
|||
World
|
||||
" \
|
||||
"Hello\n\ \tWorld" \
|
||||
"Hello\n\
|
||||
\tWorld" \
|
||||
"Hello\n\t\
|
||||
World"
|
||||
"
|
||||
Hello\n\
|
||||
\tWorld
|
||||
" \
|
||||
"
|
||||
Hello\n\t\
|
||||
World
|
||||
"
|
||||
|
||||
// Note that this file deliberately mixes space and newline indentation for
|
||||
// test purposes
|
||||
|
|
|
|||
|
|
@ -1,2 +1,4 @@
|
|||
node "Hello \
|
||||
World \ Stuff"
|
||||
node "
|
||||
Hello \
|
||||
World \ Stuff
|
||||
"
|
||||
|
|
|
|||
Loading…
Reference in New Issue