Skip to content

Commit

Permalink
Addressed all the comments made by Wouter
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Dec 14, 2014
1 parent d5be25e commit caaa272
Showing 1 changed file with 61 additions and 23 deletions.
84 changes: 61 additions & 23 deletions components/yaml/yaml_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ they can also be unquoted:
A string in YAML
.. code-block:: yaml
'A singled-quoted string in YAML'
.. code-block:: yaml
"A double-quoted string in YAML"
Quoted styles are useful when a string starts or ends with one or more
Expand All @@ -45,9 +41,32 @@ their contents.
When using single-quoted strings, any single quote ``'`` inside its contents
must be doubled to escape it:

.. code-block:: yaml
.. code-block:: yaml
'A single quote '' inside a single-quoted string'
'A single quote '' inside a single-quoted string'
If the string contains any of the following characters, it must be escaped with
single quotes:

* ``:``
* ``{``
* ``}``
* ``[``
* ``]``
* ``,``
* ``&``
* ``*``
* ``#``
* ``?``
* ``|``
* ``-``
* ``<``
* ``>``
* ``=``
* ``!``
* ``%``
* ``@``
* ``\```

The double-quoted style provides a way to express arbitrary strings, by
using ``\`` escape sequences. It is very useful when you need to embed a
Expand All @@ -57,27 +76,46 @@ using ``\`` escape sequences. It is very useful when you need to embed a
"A double-quoted string in YAML\n"
If the string contains any of the following characters, it must be escaped with
single quotes:

===== ===== ===== ===== =====
``:`` ``{`` ``}`` ``[`` ``]``
``,`` ``&`` ``*`` ``#`` ``?``
``|`` ``-`` ``<`` ``>`` ``=``
``!`` ``%`` ``@`` ``\```
===== ===== ===== ===== =====

If the string contains any of the following control characters, it must be
escaped with double quotes. In addition, the escaping must use a double slash
``\\`` to avoid parsing issues:

======== ======== ======== ======== ======== ======== ======== ========
``\0`` ``\x01`` ``\x02`` ``\x03`` ``\x04`` ``\x05`` ``\x06`` ``\a``
``\b`` ``\t`` ``\n`` ``\v`` ``\f`` ``\r`` ``\x0e`` ``\x0f``
``\x10`` ``\x11`` ``\x12`` ``\x13`` ``\x14`` ``\x15`` ``\x16`` ``\x17``
``\x18`` ``\x19`` ``\x1a`` ``\e`` ``\x1c`` ``\x1d`` ``\x1e`` ``\x1f``
``\N`` ``\_`` ``\L`` ``\P``
======== ======== ======== ======== ======== ======== ======== ========
* ``\0``
* ``\x01``
* ``\x02``
* ``\x03``
* ``\x04``
* ``\x05``
* ``\x06``
* ``\a``
* ``\b``
* ``\t``
* ``\n``
* ``\v``
* ``\f``
* ``\r``
* ``\x0e``
* ``\x0f``
* ``\x10``
* ``\x11``
* ``\x12``
* ``\x13``
* ``\x14``
* ``\x15``
* ``\x16``
* ``\x17``
* ``\x18``
* ``\x19``
* ``\x1a``
* ``\e``
* ``\x1c``
* ``\x1d``
* ``\x1e``
* ``\x1f``
* ``\N``
* ``\_``
* ``\L``
* ``\P``

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

0 comments on commit caaa272

Please sign in to comment.