Closed as not planned
Closed as not planned
Copy link
Description
Background
Yaml is nice for dumping config in a human-readable and -editable format. E.g. Drupal uses it extensively.
In that context, dumping e.g. CSS as multiline is essential for human-readability.
As discovered in #25842, and confirmed on SO and yaml-multiline.info,
- Yaml multiline is not capable of handling arbitrary characters: escaped unicode characters like
\u1234
, also "\r" is excluded in current code - Double-quoted iscapable of handling arbitrary escaped unicode values, and can span multiple lines
Researched thoroughly, so which are valid multiline literal characters:
- l-nb-literal-text = ...nb-char+
- nb-char = c-printable - b-char - c-byte-order-mark = #x9 | [#x20-#x7E] | #x85 | [#xA0-#xD7FF] | [#xE000-#xFFFD] - #xFEFF | [#x10000-#x10FFFF]
As of current code,
a) "\r" is excluded in current code, which means that any multiline string containing it will not be dumped as multiline, but as quoted scalar.
b) All other (non-printable) characters are invalid as multiline literal, so current code will produce invalid yaml.
Which means
- either we extend the "\r" blacklist with above, so to rather
- or switch to the following more robust format
Description
- Do multiline dumping like shown below (or see this fiddle). So we get multiline readability capable to encode every unicode character.
Example
dquote 0: "one\n\
two (after every litaral newline, we add an escaped yaml newline)"
dquote 1: "one\n\
two\n\
"
dquote 2: "one\n\
two\n\
\n\
"
dquote with initial space: " one \n\
two \n\
\ as we see, trailing spaces are no problem, but we need to escape initial spaces on non-first line. "
Metadata
Metadata
Assignees
Labels
RFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)