Skip to content

Instantly share code, notes, and snippets.

@wdzajicek
Last active December 3, 2020 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wdzajicek/daa26ebfc87d4973dec1d8fe2d62a263 to your computer and use it in GitHub Desktop.
Save wdzajicek/daa26ebfc87d4973dec1d8fe2d62a263 to your computer and use it in GitHub Desktop.
Creating hard line breaks in markdown files

Methods for making linebreaks in markdown

The linebreak is pretty essential element in content,
yet it's hard to find info about creating them in Markdown.

HTML line break

foo <br>
bar

foo
bar

Double spaces

Not ideal as the linebreak is an invisible character

foo  <-- two spaces
bar

foo
bar

Empty newline (not actually a linebreak)

Creates two paragraphs and not a line-break

foo

bar

foo

bar

Backslash (the best one)

foo \  <-- The space is not required
bar

foo
bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment