---
title: "Markdown line break not working? Fixes that hold"
slug: markdown-line-breaks
excerpt: "Your new line vanished after rendering. Three fixes for a Markdown line break, where each one fails, plus list items and table cells."
quickAnswer: "A Markdown line break that is not working usually means two lines in your file came out joined after rendering. This page names three fixes: a backslash, trailing spaces or a br tag. The body says where each one fails, how to check a file for the cause, and what to do inside list items and table cells. Paragraphs and the other basic elements are in the Markdown syntax guide."
keyTakeaways:
  - "The opening section shows why a single line ending in your file can disappear on the rendered page."
  - "Three fixes are covered: a backslash, trailing spaces and a br tag. Each has its own section."
  - "A numbered checklist in the body walks through the places where a break is ignored."
  - "List items and table cells each get a short section with a worked example."
  - "The Picking a fix section weighs the three fixes for files that agents write."
publishedDate: 2026-10-20
dateModified: 2026-10-20
author: Bobby Huang
cluster: B
role: post
status: published
faq:
  - q: Why are my two trailing spaces ignored?
    a: "The checklist in the body covers each place a break is ignored, plus the case where the spaces were stripped."
  - q: Is a backslash safer than trailing spaces?
    a: "The comparison near the bottom of the page weighs the two and explains the trade-offs."
  - q: Can a table cell hold two lines?
    a: "The table cell section shows the usual approach and how viewers differ on it."
related:
  - markdown-syntax-guide
  - markdown-tables
  - raw-html-in-markdown
---

You typed a name on one line and a company on the next. In the raw file they sit on two lines. Rendered, they've merged: "Jane Doe Doe Holdings."

Your renderer is doing its job. A single line ending partway through a paragraph just doesn't mean "new line" in Markdown. You'll get the three fixes, the spots where each one gets ignored, and the two places people trip most: list items and table cells. For paragraphs, headings and the rest of the basics, use the [Markdown syntax guide](markdown-syntax-guide.md).

## Why one line ending isn't enough

CommonMark has a name for a lone line ending in a paragraph: a soft line break. The spec says the HTML may hold either a newline or a space there, and that both look the same on screen. Either way, the reader sees one flowing line.

Pandoc makes this easy to see. Given a file with `Jane Doe` on line one and `Doe Holdings` on line two:

```markdown
Jane Doe
Doe Holdings
```

running `pandoc -f commonmark -t html soft.md` prints `<p>Jane Doe Doe Holdings</p>`. Two lines went in, one came out.

The spec also allows a renderer to offer a setting that renders every soft break as a hard break. Pandoc has one, the `hard_line_breaks` extension. Some viewers may behave that way by default, so a file can look right in one app and merged in another. Don't build on that if your file travels.

An empty line between them also keeps the two apart. But that makes two paragraphs, and many viewers put a gap between paragraphs. That gap rarely suits a mailing label or a signature.

## The three fixes

### Trailing spaces

Finish the line with two or more spaces. CommonMark reads that line ending as a hard break, which comes out in HTML as `<br />`.

```markdown
Jane Doe··
Doe Holdings
```

The `·` marks stand for spaces; type real ones. With two spaces, pandoc prints `<p>Jane Doe<br />` and then `Doe Holdings</p>` on the next line. With just one space, it prints the merged line again.

Trouble is, nobody can see trailing spaces. Certain editors and formatters trim them on save, so the break can vanish without anyone touching that line. They also add noise to diffs; [why small diffs matter](keep-agent-markdown-diffs-small.md) explains the review side.

### A backslash

Put `\` at the very end of the line, with nothing after it.

```markdown
Jane Doe\
Doe Holdings
```

CommonMark treats a backslash before the line ending as the visible version of the two-space form. Pandoc gives the same `<br />` output for both files. You can spot the backslash in the source, and whitespace trimming leaves it alone.

### A br tag

Write `Jane Doe<br>Doe Holdings` on one line. CommonMark hands raw HTML tags through unescaped, and pandoc prints the tag unchanged inside the paragraph. Whether you see a break then depends on the viewer. Some render HTML, some strip it, and some print the tag as text. Our post on [HTML tags in Markdown files](raw-html-in-markdown.md) covers those differences.

## Still one line? Check these

Work through these checks one at a time.

1. **Look at where the break sits.** A hard break splits text inside one block. When it sits on a paragraph's closing line, or on a heading's only line, it does nothing. Trailing spaces there are dropped. A trailing backslash there stays in the output as a plain `\`; pandoc renders `## Jane Doe\` as a heading whose text keeps the backslash.
2. **Look for backticks.** Neither form breaks a line inside a code span. The spec's examples keep the spaces as spaces and the backslash as a backslash. When tested locally, a code span that ran from `Jane Doe\` onto a second line came out of pandoc as one `<code>` element with no `<br />`.
3. **Check for a code block.** Fenced and indented code blocks hold literal text that the parser never treats as Markdown, so the lines already stay apart and a backslash prints as written. Our [code block post](markdown-code-blocks.md) shows where a fence starts and ends.
4. **Check for an HTML tag.** If the line ending falls inside a quoted attribute value, the spaces or backslash stay part of the tag and pass straight through.
5. **Look at the next line.** Hyphens alone on the line below can make the text above a heading. On that upper line, trailing spaces don't add a break; pandoc turned `Jane Doe··` over `-----` into a plain `<h2>`.
6. **Confirm the spaces survived.** Many editors can show whitespace; turn that on and check every line that should break. If the two spaces are gone, something stripped them. Switch that line to a backslash.

## List items

A list item's text is parsed as a paragraph, so both Markdown forms work there too.

```markdown
- Jane Doe\
  Doe Holdings
- Next item
```

Pandoc renders that as one bullet with a `<br />` between the two names, followed by a second bullet. Line the second line up under the item's text, as above. Under the spec's laziness rule, a continuation line with no indent still joins the paragraph, and pandoc gave the same output without the indent. The indented version reads more clearly, though, and it keeps the structure obvious once you nest lists. Indent and nesting rules are in the [nested lists post](markdown-block-quotes-nested-lists.md).

For a gap instead of a break, add an empty line and start a second paragraph indented to match the item text.

## Table cells

Tables aren't part of core CommonMark. They belong to a common table extension. That extension's spec limits cells to inline content and bars block elements from a table. Each table row is a single line of source.

So neither Markdown form helps. Take a cell that ends in `1 Doe Lane\` with `Doe City |` on the next line. In a local pandoc test with that table extension turned on, the backslash stays as text and `Doe City` starts a new row.

The common workaround is `<br>` placed in the cell:

```markdown
| Name | Address |
| --- | --- |
| Jane Doe | 1 Doe Lane<br>Doe City |
```

Pandoc kept the tag inside the cell's `<td>` element. Many viewers draw that cell with the address split over two lines. Some may strip the tag or print it as text, so the address either merges or shows `<br>` on screen. If every reader must see the break, shorten the cell and move the detail into bullets below the table. Other cell limits are in the [tables post](markdown-tables.md).

## Picking a fix

- **Backslash:** the default for paragraphs and list items. It's easy to spot, it's in the CommonMark spec, and save-time trimming won't remove it.
- **Trailing spaces:** fine for files that already use them, as long as nothing in your setup trims whitespace. Keep the check from step 6 handy.
- **Inline `<br>`:** inside table cells, after confirming that the viewer your readers use shows it.

For files an agent writes, put the choice in its instruction file in one plain sentence, such as "End a line with a backslash when you need a line break; do not use trailing spaces." The check from step 6 then tells you whether it listened. Our [guide to wording agent rules](write-markdown-docs-your-ai-agent-can-follow.md) covers how to phrase rules like this.

## Where Sashmark fits

Sashmark is desktop software in the works for reading and fixing .md files that agents rewrite again and again. It is in development and has not been released. The app itself has no AI features. The v1 plan covers live rendering of lists, tables and block quotes, plus direct edits on that formatted view, table cells included. Lines you leave alone should keep every byte on save, trailing spaces and all. The plan treats raw HTML as inert, one more reason to reach for the backslash. See the [roadmap](/roadmap) for where each piece stands, with details under [planned features](/features) and in the [help pages](/help).

Follow the project at [sashmark.com](https://www.sashmark.com/).
