Igor Kudrin 652ceaddc0
[YAMLParser] Unfold multi-line scalar values (#70898)
Long scalar values can be split into multiple lines to improve
readability. The rules are described in Section 6.5. "Line Folding",
https://yaml.org/spec/1.2.2/#65-line-folding. In addition, for flow
scalar styles, the Spec states that "All leading and trailing white
space characters on each line are excluded from the content",
https://yaml.org/spec/1.2.2/#73-flow-scalar-styles.

The patch implements these unfolding rules for double-quoted,
single-quoted, and plain scalars.
2023-11-10 07:19:24 +07:00

15 lines
477 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# RUN: yaml-bench -canonical %s | FileCheck %s --strict-whitespace
# CHECK: "as space trimmed\nspecific\L none"
## Note: The parsing rules were changed in version 1.2 and the line-separator
## character is no longer considered a line-break character. The example is
## taken from Spec 1.1 and is now parsed as "..\L .." instead of "..\L\n.." as
## in the original edition.
## See https://yaml.org/spec/1.2.2/ext/changes/ for details.
as space
trimmed
specific
none