What to Do With Long Strings in YAML?
What to Do With Long Strings in YAML? YAML already defines this. In this case, there are four methods:
|: Newlines under it are preserved as newlines, and the last line ends with a newline. >: Newlines under it are folded into spaces, forming a long string, and the last line ends with a newline. |-: Newlines under it are preserved, but the last line does not end with a newline. >-: Newlines under it are folded into spaces, and the last line does not end with a newline. In short, > and >- improve YAML readability without adding extra newline characters. | and |- keep the string exactly as defined: if you see a newline in YAML, the string contains a newline.