Markdown Line Breaks with Copyable Examples
Add a line break in Markdown with a backslash or spaces. Compare paragraph spacing, fix missing breaks in a README and preview a real PNG.
For a new line within the same Markdown paragraph, end the first line with a backslash or two spaces, then press Enter. For a new paragraph, leave a blank line. Use the backslash if your editor removes trailing spaces.
Copy the contents of the code block. The first example keeps the owner and date together. The second gives each its own paragraph.
### One paragraph, two lines
Owner: Docs team\
Review: Friday
### Two paragraphs
Owner: Docs team
Review: Friday
| Desired result | What to type |
|---|---|
| New line in the same paragraph | End the first line with a backslash or two spaces. |
| Two paragraphs | Leave an empty line between them. |
| A separate source line that can render as a space | Press Enter once without a marker. |
CommonMark calls these marked and unmarked line endings hard and soft line breaks. CommonMark line break rules
GitHub shows a plain newline as a break in issues, pull requests and discussions. In a Markdown file such as a README, the two lines can run together. Add a hard break and check the file preview. If it disappears on save, check for trimmed trailing spaces. If the backslash prints literally, check that it is the last character on a line inside the paragraph. GitHub's line break guide
Paste the example into the image editor. We tested it there and downloaded the PNG below. The editor also displays an ordinary newline as a break, so check the README itself before publishing there. For a slide or release update, use the image to keep the spacing shown in the preview. Try the example in Markdown2Image