I’m creating a Markdown file with paragraphs that include a link and a line of text immediately after it.
When I add a new line after the link, it gets rendered as a separate <p>
tag instead of staying in the same paragraph. I want the output to have the link and the next line of text in the same paragraph, separated by a line break.
How can I achieve this using a Markdown line break?
Hey! I’ve struggled with this before
. In Markdown, a simple way to add a line break without creating a new paragraph is to put two spaces at the end of the line:
Here’s a link with some text.
This line will appear right below it in the same paragraph.
Those two spaces tell Markdown to render a <br>
instead of a <p>
.
Works reliably on GitHub, VS Code, and most Markdown renderers.
Using the explicit <br>
tag
If you want something more obvious, you can just insert an HTML <br>
:
Here’s a link with some text.<br>
This line will appear immediately below it in the same paragraph.
Markdown supports inline HTML, so <br>
works everywhere.
I usually use this when I want the break to be super explicit or when two spaces are easy to miss.
Combining multiple line breaks or spacing tricks
Sometimes I’m working on Markdown that gets converted to HTML differently (like Jekyll or Pandoc). A trick I often use:
Here’s a link with some text.
This line will appear below in the same paragraph.
ensures the renderer doesn’t collapse whitespace, keeping the line visually separated.
Works when spacing-only tricks aren’t reliable in custom renderers.