@@ -34,9 +34,9 @@ they can also be unquoted:
3434
3535 " A double-quoted string in YAML"
3636
37- Quoted styles are useful when a string starts or ends with one or more
38- relevant spaces, because unquoted strings are trimmed on both ends when parsing
39- their contents.
37+ Quoted styles are useful when a string starts or end with one or more relevant
38+ spaces, because unquoted strings are trimmed on both end when parsing their
39+ contents. Quotes are required when the string contains special or reserved characters .
4040
4141When using single-quoted strings, any single quote ``' `` inside its contents
4242must be doubled to escape it:
@@ -49,25 +49,8 @@ Strings containing any of the following characters must be quoted. Although you
4949can use double quotes, for these characters it is more convenient to use single
5050quotes, which avoids having to escape any backslash ``\ ``:
5151
52- * ``: ``
53- * ``{ ``
54- * ``} ``
55- * ``[ ``
56- * ``] ``
57- * ``, ``
58- * ``& ``
59- * ``* ``
60- * ``# ``
61- * ``? ``
62- * ``| ``
63- * ``- ``
64- * ``< ``
65- * ``> ``
66- * ``= ``
67- * ``! ``
68- * ``% ``
69- * ``@ ``
70- * ``\` ``
52+ * ``: ``, ``{ ``, ``} ``, ``[ ``, ``] ``, ``, ``, ``& ``, ``* ``, ``# ``, ``? ``, ``| ``,
53+ ``- ``, ``< ``, ``> ``, ``= ``, ``! ``, ``% ``, ``@ ``, ``\` ``
7154
7255The double-quoted style provides a way to express arbitrary strings, by
7356using ``\ `` to escape characters and sequences. For instance, it is very useful
@@ -80,42 +63,11 @@ when you need to embed a ``\n`` or a Unicode character in a string.
8063 If the string contains any of the following control characters, it must be
8164escaped with double quotes:
8265
83- * ``\0 ``
84- * ``\x01 ``
85- * ``\x02 ``
86- * ``\x03 ``
87- * ``\x04 ``
88- * ``\x05 ``
89- * ``\x06 ``
90- * ``\a ``
91- * ``\b ``
92- * ``\t ``
93- * ``\n ``
94- * ``\v ``
95- * ``\f ``
96- * ``\r ``
97- * ``\x0e ``
98- * ``\x0f ``
99- * ``\x10 ``
100- * ``\x11 ``
101- * ``\x12 ``
102- * ``\x13 ``
103- * ``\x14 ``
104- * ``\x15 ``
105- * ``\x16 ``
106- * ``\x17 ``
107- * ``\x18 ``
108- * ``\x19 ``
109- * ``\x1a ``
110- * ``\e ``
111- * ``\x1c ``
112- * ``\x1d ``
113- * ``\x1e ``
114- * ``\x1f ``
115- * ``\N ``
116- * ``\_ ``
117- * ``\L ``
118- * ``\P ``
66+ * ``\0 ``, ``\x01 ``, ``\x02 ``, ``\x03 ``, ``\x04 ``, ``\x05 ``, ``\x06 ``, ``\a ``,
67+ ``\b ``, ``\t ``, ``\n ``, ``\v ``, ``\f ``, ``\r ``, ``\x0e ``, ``\x0f ``, ``\x10 ``,
68+ ``\x11 ``, ``\x12 ``, ``\x13 ``, ``\x14 ``, ``\x15 ``, ``\x16 ``, ``\x17 ``, ``\x18 ``,
69+ ``\x19 ``, ``\x1a ``, ``\e ``, ``\x1c ``, ``\x1d ``, ``\x1e ``, ``\x1f ``, ``\N ``,
70+ ``\_ ``, ``\L ``, ``\P ``
11971
12072Finally, there are other cases when the strings must be quoted, no matter if
12173you're using single or double quotes:
0 commit comments