Hard Line Breaks

Adjacent lines of regular text in AsciiDoc are combined into a single paragraph when converted. That means you can wrap paragraph text in the source document, either at a specific column or by putting each sentence or phrase on its own line. The line breaks separating adjacent lines won’t appear in the output. Instead, the line break will be converted to a single space. (In fact, all repeating space characters are reduced to a single space, just like in HTML.)

Hard line breaks are automatically retained in literal, listing, source, and verse blocks and paragraphs.

If you want line breaks in a paragraph to be preserved, there are several techniques you can use. For any single line, you can terminate it with a space followed by a plus sign (i.e., {plus}). This syntax signals to the processor to end the line in the output with a hard line break. To add this behavior to every line in the paragraph, set the hardbreaks option on the paragraph instead. Alternately, you can tell the processor to preserve all line breaks in every paragraph in the document by setting the hardbreaks-option document attribute, though this option should be used wisely.

To insert an empty line somewhere in a paragraph, you can use the hard line break syntax (i.e., {empty}{plus}) on a line by itself. This allows you to insert space between lines in the output without introducing separate paragraphs.

Inline line break syntax

To preserve a line break in a paragraph, insert a space followed by a plus sign (+) at the end of the line. This results in a visible line break (e.g., <br>) following the line.

Example 1. Line breaks preserved using a space followed by the plus sign (+)
Rubies are red, +
Topazes are blue.

The result of Example 1 is displayed below.

Rubies are red,
Topazes are blue.

hardbreaks option

To retain all of the line breaks in an entire paragraph, assign the hardbreaks option to the paragraph using an attribute list.

Example 2. Line breaks preserved using the hardbreaks option
[%hardbreaks]
Ruby is red.
Java is beige.

The result of Example 2 is displayed below.

Ruby is red.
Java is beige.

hardbreaks-option attribute

To preserve line breaks in all paragraphs throughout your entire document, set the hardbreaks-option document attribute in the document header.

Example 3. Line breaks preserved throughout the document using the hardbreaks-option attribute
= Line Break Doc Title
:hardbreaks-option:

Rubies are red,
Topazes are blue.