How to force a linebreak?

tl;dr

In short, you can't with pure Markdown. You need to use raw HTML and/or CSS styles. The simplest is to insert <br/><br/> into your document.

The long explanation

Browsers determine how to display the various HTML elements in a page by obtaining instructions from style sheets. Those style sheets can be obtained from multiple sources: (1) the browser's default style sheets, (2) local user-defined style sheets, (3) style sheets provided by the document author, and (4) inline styles embedded in the HTML (this fascinating, albeit lengthy, article breaks down the entire process).

What we want to consider is the first; the browser's default style sheets. These tell the browser the default styles for the various elements, the padding of a paragraph, the size of the different level headers, the indentation and bullets of list items, etc. In fact, a quick search turns up a whole slew of so-called "reset" style sheets which undo all these default styles.

This is what you are encountering, the default styles are not providing sufficient padding between the image and the paragraph following it. You have a few options to address this:

  1. Define a user style sheet (stored on your local machine) which your browser would use to alter/override the default style sheet. Of course, this would only effect you on that machine. Any other machine would still use the default styles.

  2. Define a style sheet for your page which gets attached to the page through a template or something. However, if you are posting your documents on a host which doesn't allow such control (like a wiki), then that won't help either.

  3. Define some inline styles within the document. Of course, this means you would need to define raw HTML for your image. And on some services, the raw HTML and/or inline CSS might be stripped out.

In the end it all depends on how you intend to use your documents. But that don't really answer your question. How can you accomplish this in Markdown? In short, you can't.

As the author of Markdown explains (emphasis preserved):

Markdown's syntax is intended for one purpose: to be used as a format for writing for the web.

Markdown is not a replacement for HTML, or even close to it. Its syntax is very small, corresponding only to a very small subset of HTML tags. The idea is not to create a syntax that makes it easier to insert HTML tags. In my opinion, HTML tags are already easy to insert. The idea for Markdown is to make it easy to read, write, and edit prose. HTML is a publishing format; Markdown is a writing format. Thus, Markdown's formatting syntax only addresses issues that can be conveyed in plain text.

If you are concerned about padding between elements, you are concerned with formatting, not writing, which is beyond the intended scope of Markdown. Yes, it is possible to revert to raw HTML (possibly with embedded inline CSS) to force your desired formatting, but that is exactly how it is supposed to work. In fact, the next paragraph in the above quoted document states:

For any markup that is not covered by Markdown's syntax, you simply use HTML itself. There's no need to preface it or delimit it to indicate that you're switching from Markdown to HTML; you just use the tags.

So, the appropriate way to address your issue is with raw HTML and/or CSS, not with some special Markdown syntax.


Short answer: two spaces at the end of the line

Details:

I am providing an updated answer, since @xof's answer, which while was incomplete was correct (per the docs):

When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.

Yes, this takes a tad more effort to create a <br />, but a simplistic “every line break is a <br />” rule wouldn’t work for Markdown. Markdown’s email-style blockquoting and multi-paragraph list items work best — and look better — when you format them with hard breaks.

Also, this has the extra benefit of avoiding the document unnecessarily becoming a mix of markdown and HTML. This retains readability, for when a Markdown viewer is not available, such as in a terminal window.

Just one thing: don't do a global trim on trailing spaces, as is often habit for source code, otherwise you'll lose important formatting.


Line break in Markdown is "two or more spaces at the end of the line".


A Backslash \ at the end of the line does also seem to work. And it is not removed by trailing space removal.