Skip to content

Commit caaa272

Browse files
committed
Addressed all the comments made by Wouter
1 parent d5be25e commit caaa272

File tree

1 file changed

+61
-23
lines changed

1 file changed

+61
-23
lines changed

components/yaml/yaml_format.rst

+61-23
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ they can also be unquoted:
3030
3131
A string in YAML
3232
33-
.. code-block:: yaml
34-
3533
'A singled-quoted string in YAML'
3634
37-
.. code-block:: yaml
38-
3935
"A double-quoted string in YAML"
4036
4137
Quoted styles are useful when a string starts or ends with one or more
@@ -45,9 +41,32 @@ their contents.
4541
When using single-quoted strings, any single quote ``'`` inside its contents
4642
must be doubled to escape it:
4743

48-
.. code-block:: yaml
44+
.. code-block:: yaml
4945
50-
'A single quote '' inside a single-quoted string'
46+
'A single quote '' inside a single-quoted string'
47+
48+
If the string contains any of the following characters, it must be escaped with
49+
single quotes:
50+
51+
* ``:``
52+
* ``{``
53+
* ``}``
54+
* ``[``
55+
* ``]``
56+
* ``,``
57+
* ``&``
58+
* ``*``
59+
* ``#``
60+
* ``?``
61+
* ``|``
62+
* ``-``
63+
* ``<``
64+
* ``>``
65+
* ``=``
66+
* ``!``
67+
* ``%``
68+
* ``@``
69+
* ``\```
5170

5271
The double-quoted style provides a way to express arbitrary strings, by
5372
using ``\`` escape sequences. It is very useful when you need to embed a
@@ -57,27 +76,46 @@ using ``\`` escape sequences. It is very useful when you need to embed a
5776
5877
"A double-quoted string in YAML\n"
5978
60-
If the string contains any of the following characters, it must be escaped with
61-
single quotes:
62-
63-
===== ===== ===== ===== =====
64-
``:`` ``{`` ``}`` ``[`` ``]``
65-
``,`` ``&`` ``*`` ``#`` ``?``
66-
``|`` ``-`` ``<`` ``>`` ``=``
67-
``!`` ``%`` ``@`` ``\```
68-
===== ===== ===== ===== =====
69-
7079
If the string contains any of the following control characters, it must be
7180
escaped with double quotes. In addition, the escaping must use a double slash
7281
``\\`` to avoid parsing issues:
7382

74-
======== ======== ======== ======== ======== ======== ======== ========
75-
``\0`` ``\x01`` ``\x02`` ``\x03`` ``\x04`` ``\x05`` ``\x06`` ``\a``
76-
``\b`` ``\t`` ``\n`` ``\v`` ``\f`` ``\r`` ``\x0e`` ``\x0f``
77-
``\x10`` ``\x11`` ``\x12`` ``\x13`` ``\x14`` ``\x15`` ``\x16`` ``\x17``
78-
``\x18`` ``\x19`` ``\x1a`` ``\e`` ``\x1c`` ``\x1d`` ``\x1e`` ``\x1f``
79-
``\N`` ``\_`` ``\L`` ``\P``
80-
======== ======== ======== ======== ======== ======== ======== ========
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``
81119

82120
When a string contains line breaks, you can use the literal style, indicated
83121
by the pipe (``|``), to indicate that the string will span several lines. In

0 commit comments

Comments
 (0)