Skip to content

Commit ec781c6

Browse files
committed
UG: Clarify \n in documentation paragraphs. Fixes robotframework#3021.
1 parent 78fee7d commit ec781c6

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

doc/userguide/src/Appendices/DocumentationFormatting.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ to test suites, newlines can be added manually using `\n` `escape sequence`_.
3131
.. sourcecode:: robotframework
3232

3333
*** Settings ***
34-
Documentation First line.\n\nSecond paragraph, this time\nwith multiple lines.
35-
Metadata Example Value\nin two lines
34+
Documentation First line.\n\nSecond paragraph. This time\nwith multiple lines.
35+
Metadata Example list - first item\n- second item\n-third
36+
37+
.. note:: As explained in the Paragraphs_ section below, the single newline in
38+
`Second paragraph, this time\nwith multiple lines.` does not actually
39+
affect how that paragraph is rendered. Newlines are needed when
40+
constructing lists_, though.
3641

3742
Adding newlines manually to a long documentation takes some effort and extra
3843
characters also make the documentation harder to read. This can be avoided,
@@ -46,12 +51,12 @@ means that the above example could be written also as follows.
4651
Documentation
4752
... First line.
4853
...
49-
... Second paragraph, this time
54+
... Second paragraph. This time
5055
... with multiple lines.
51-
Metadata
52-
... Example
53-
... Value
54-
... in two lines
56+
Metadata Example list
57+
... - first item
58+
... - second item
59+
... - third
5560

5661
No automatic newline is added if a line already ends with a literal newline
5762
or if it ends with an `escaping backslash`__. If documentation or metadata

0 commit comments

Comments
 (0)