From 2824867ce86cf2ab0e2510d8d687d3535174fce0 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 29 Dec 2014 16:47:07 +0100 Subject: [PATCH] Rewroded some contents and fixed some lists of elements --- components/yaml/yaml_format.rst | 68 +++++---------------------------- 1 file changed, 10 insertions(+), 58 deletions(-) diff --git a/components/yaml/yaml_format.rst b/components/yaml/yaml_format.rst index 9e01336734e..c8a6f4a0813 100644 --- a/components/yaml/yaml_format.rst +++ b/components/yaml/yaml_format.rst @@ -34,9 +34,9 @@ they can also be unquoted: "A double-quoted string in YAML" -Quoted styles are useful when a string starts or ends with one or more -relevant spaces, because unquoted strings are trimmed on both ends when parsing -their contents. +Quoted styles are useful when a string starts or end with one or more relevant +spaces, because unquoted strings are trimmed on both end when parsing their +contents. Quotes are required when the string contains special or reserved characters. When using single-quoted strings, any single quote ``'`` inside its contents must be doubled to escape it: @@ -49,25 +49,8 @@ Strings containing any of the following characters must be quoted. Although you can use double quotes, for these characters it is more convenient to use single quotes, which avoids having to escape any backslash ``\``: -* ``:`` -* ``{`` -* ``}`` -* ``[`` -* ``]`` -* ``,`` -* ``&`` -* ``*`` -* ``#`` -* ``?`` -* ``|`` -* ``-`` -* ``<`` -* ``>`` -* ``=`` -* ``!`` -* ``%`` -* ``@`` -* ``\``` +* ``:``, ``{``, ``}``, ``[``, ``]``, ``,``, ``&``, ``*``, ``#``, ``?``, ``|``, + ``-``, ``<``, ``>``, ``=``, ``!``, ``%``, ``@``, ``\``` The double-quoted style provides a way to express arbitrary strings, by using ``\`` 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. If the string contains any of the following control characters, it must be escaped with double quotes: -* ``\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`` Finally, there are other cases when the strings must be quoted, no matter if you're using single or double quotes: