How to add and view line breaks in Obsidian
Editor Settings
In the options, under “Editor”, you’ll find a setting called Strict line breaks
. If that toggle is on
, Obsidian will render your markdown normally, i.e. a single line break is ignored and this is also how document appears when it is published as a web page.
How to add line breaks
A single line break, i.e. pressing enter one time are usually ignored by markdown renderers. Pressing enter two times yields an actual new line break in the rendered markdown (this is equivalent to CRLF, Carriage Return and Line Feed).
To add a line break (<br>
) in Markdown, put 2 spaces or a backslash (’ \
‘)at the end of a line. The spaces are standard Markdown. The backslash is a common Markdown extension included In CommonMark, which many Markdown variants are based on including that of Obsidian.
View markdown whitespace characters in VSCode
Install a plugin e.g. Render Line Endings Displays the line ending symbol and optionally extra whitespace when ‘Render whitespace’ is turned on
This extension shows end-of-line characters (CR, LF, or CRLF) when whitespace rendering is turned on. Additionally, it can mark all non-default line endings in a different color. It can be also configured to show trailing whitespace characters as errors.
Since the extension only renders visible portion of text, it’s fast, even for huge documents. It fully supports language-specific EOL and whitespace settings.
If whitespace rendering is turned on, you will see the symbol for either LF (↓
), CRLF (↵
), or CR (←
).
Render Whitespace
Whether extension is decorating or not is handled by editor.renderWhitespace
setting (accessible through View > Appearance > Render Whitespace
). The following settings are supported:
none
: Extension will not add end-of-line decorations.boundary
: Extension will not add end-of-line decorations.selection
: Extension will render end-of-line decorations only if they are within selection.all
: Extension will render all end-of-line decorations.