Skip to content

Commit d5ec5a1

Browse files
authored
Create hard line breaks demo
1 parent c83659e commit d5ec5a1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

‎hard-line-breaks.adoc‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
By default, newlines between consecutive lines in prose (i.e., paragraph text) are not preserved. They are treated as a single space, just like in HTML.
2+
3+
first line
4+
second line
5+
third line
6+
7+
If you want newlines to be preserved as hard line breaks, you can add the `hardbreaks` option to the paragraph.
8+
9+
[%hardbreaks]
10+
first line
11+
second line
12+
third line
13+
14+
If you want to set this option globally, define the `hardbreaks` attribute in the document header (but know what you are doing).
15+
16+
A third option is to add explicit hard line breaks in the source by adding a space followed by a plus to the end of the line.
17+
18+
first line +
19+
second line +
20+
third line
21+
22+
Newlines are always preserved in preformatted blocks, such as a literal paragraph, literal block, or listing block.
23+
24+
first line
25+
second line
26+
third line

0 commit comments

Comments
 (0)