---
title: "Markdown new paragraph not working? Blank lines explained"
slug: markdown-paragraphs-blank-lines
excerpt: "Two paragraphs merged into one, or a sentence became a heading? What a blank line does in Markdown, and how to fix each case."
quickAnswer: "This page covers why lines you meant as separate paragraphs can run together, turn into a heading or land inside a quote. It also explains how the CommonMark spec defines a paragraph and what a blank line does. Its other sections cover stacked blank lines, indented lines, the blocks that can start without a blank line, the heading trap and stray lines in quotes and list items. See 'Fixing a paragraph that won't split' for a checklist."
keyTakeaways:
  - "The sections on what counts as a paragraph and on one line break versus a blank line show what the spec calls a paragraph and what ends one."
  - "The section on extra blank lines covers what happens when you stack several of them."
  - "Indented lines get their own section, with pandoc output for each case."
  - "A list of block types shows which ones can start mid-paragraph, each with its spec line."
  - "The heading trap and lazy quote lines each get a worked example and a repair."
publishedDate: 2026-10-20
dateModified: 2026-10-20
author: Bobby Huang
cluster: B
role: post
status: published
faq:
  - q: What turned my sentence into a heading?
    a: "The heading trap section shows the line that causes it and two fixes."
  - q: Do two blank lines make a bigger gap than one?
    a: "The section on stacking blank lines answers this, with pandoc output to compare."
  - q: How did my next paragraph get pulled into a quote?
    a: "The section on lazy lines walks through the cause and the fix."
related:
  - markdown-line-breaks
  - markdown-numbered-lists
  - markdown-block-quotes-nested-lists
---

Your agent drafts a status update, one point per line. You open the rendered page and every point has run together into one long block. Or one sentence now sits in bold heading type for no clear reason.

Markdown decides where a paragraph starts and stops by looking at blank lines and at the line that follows your text. Learn the few rules involved and a broken file is quick to repair. Everything here follows CommonMark 0.31.2, and every example was checked with pandoc.

## What counts as a paragraph

The spec defines a paragraph as a run of non-blank lines that can't be read as any other kind of block. Its text is those lines joined together, with spaces or tabs trimmed from both ends, then parsed for things like emphasis and links.

A blank line, in spec terms, is a line with nothing on it, or with only spaces or tabs. So a line holding three spaces still counts as blank.

## One line break versus a blank line

One line break on its own keeps text in the same paragraph. Here is a file named `plan.md`:

```markdown
Jane Doe drafted the plan.
The agent rewrote step two.
```

Running `pandoc -f commonmark -t html plan.md` gives `<p>Jane Doe drafted the plan. The agent rewrote step two.</p>`. The two lines went into a single paragraph.

Separate them with a blank line and pandoc prints two elements instead: `<p>Jane Doe drafted the plan.</p>` followed by `<p>The agent rewrote step two.</p>`. That blank line is the whole fix in the simplest case.

If you wanted a new line inside the same paragraph, rather than a new paragraph, that's a hard line break, and our [line breaks post](markdown-line-breaks.md) covers it.

## Extra blank lines don't add space

Typing three or four blank lines to push paragraphs further apart won't work. The spec says that blank lines between blocks are ignored, and that blank lines at the very start or end of a file are ignored too. Its example with several blank lines between two paragraphs produces the same two `<p>` elements as one blank line does. Testing three blank lines in pandoc gave the identical output.

The spec names one exception: inside a list, blank lines decide whether the list is tight or loose. The [numbered lists post](markdown-numbered-lists.md) explains what that changes.

The gap you see between paragraphs comes from the page's styling; the HTML pandoc printed has no extra element for it. Many viewers set that gap once for every paragraph, so in those viewers, extra blank lines in the source don't make it larger.

## Indented lines

Leading spaces on a paragraph's first line are stripped, up to three of them. `   Jane Doe drafted the plan.` with three leading spaces renders as a plain paragraph.

Four spaces is where it changes. With four spaces in front of the first line, pandoc printed a `<pre><code>` block holding that line, then a separate paragraph for the next one. That's an indented code block; the [code block guide](markdown-code-blocks.md) explains how those start and end.

Lines after the first are different. They may be indented by any amount, because an indented code block cannot interrupt a paragraph. A second line pushed eight spaces in still joined the first line's paragraph in a local test. So indenting a follow-on line won't split anything off, and it won't make code.

## Blocks that can start mid-paragraph

Some blocks end the paragraph above them even when no empty line comes first. The spec says so for each type:

- **ATX headings.** A line starting with `## ` ends the paragraph and starts a heading (spec lines 1209-1210).
- **Thematic breaks.** A `***` line closes the paragraph and becomes `<hr />` (line 983). A `---` line right under text is different: the spec reads that line as a setext heading underline instead (lines 994-998), which leads to the heading trap below.
- **Fenced code blocks.** An opening fence of three backticks or three tildes starts code right away (lines 1837-1838).
- **Block quotes.** A line starting with `>` ends the paragraph and opens a quote (line 3687).
- **HTML blocks, some of them.** The spec sorts HTML blocks into seven types, and only type 7 can't interrupt a paragraph (lines 2283-2284). A `<div>` line after a sentence started an HTML block in pandoc. A `<span>` line stayed inside the paragraph as inline HTML. The [raw HTML post](raw-html-in-markdown.md) goes further into tags.

Two things can't break in. One is an indented code block (line 1635), as shown above. A link reference definition can't either (line 3195): `[doe]: /plan` typed right under a sentence stayed in the paragraph as plain text.

Lists have their own rules for starting right after a sentence. The [numbered lists post](markdown-numbered-lists.md) sets those out, so they aren't repeated here.

## The heading trap

This is the one that turns a sentence into a heading. A line made only of `=` signs or only of `-` signs, sitting under paragraph text, counts as a setext heading underline. Equals signs give a level 1 heading and hyphens give level 2 (spec lines 1255-1260).

```markdown
Status for Doe Holdings
---
The agent closed three tasks.
```

Pandoc turned that into `<h2>Status for Doe Holdings</h2>` and a paragraph. In CommonMark, a setext heading can't interrupt a paragraph, so without a blank line the paragraph's text becomes the heading's content (lines 1263-1266 and 1459-1461). With two lines of text above the dashes, both lines end up in the heading (example 95).

Two fixes held up in pandoc:

1. **Separate the dashes with an empty line.** With an empty line separating the text from `---`, pandoc printed `<p>Status for Doe Holdings</p>` and then `<hr />`.
2. **Use stars for the divider.** A `***` line cannot underline a heading, so it closed the paragraph and printed `<hr />` without needing a blank line.

The [horizontal rules post](markdown-horizontal-rules.md) compares divider styles in more depth.

## Lazy lines in quotes and list items

A block quote marks each line with `>`. The spec's laziness rule lets you drop that marker on a line that would otherwise continue the quote's paragraph (lines 3428-3433). The line still belongs to the quote.

That rule is why a quote can swallow the paragraph after it:

```markdown
> A note from Doe Holdings.
The agent rewrote step two.
```

Pandoc put both sentences inside one `<blockquote>`. The spec says it plainly: laziness means you need an empty line to separate a block quote from the paragraph that follows it (lines 3716-3717). With that blank line, or a line holding just `>`, the second sentence came out as its own paragraph after the quote in a local test.

Laziness only covers paragraph text (lines 3527-3528). A `---` line directly under a quote line doesn't continue it, so it won't underline the quoted text. Pandoc rendered `> A note from Doe Holdings.` with `---` under it as a quote followed by `<hr />`, matching spec example 92.

List items work the same way. The spec's list-item laziness rule lets a continuation line lose its indent and still belong to the item's paragraph (lines 4476-4483). `- Call Jane Doe.` followed by `Ask about the plan.` on its own line gave one `<li>` holding both sentences. Once an empty line separated them, the second sentence became a paragraph after the list. The [guide to quotes and nested lists](markdown-block-quotes-nested-lists.md) goes into indents inside items.

## Fixing a paragraph that won't split

Go down this list on the lines that misbehave:

1. **Look for the blank line.** Two runs of plain text with no empty line between them merge into one paragraph. Add one.
2. **Check that the blank line is blank.** A line with only spaces or tabs counts as blank, but a line holding any other character, even a single dot, does not.
3. **Look under the text.** A line of `=` or `-` right below a sentence is the heading trap. Insert one empty line over it or switch the divider to `***`.
4. **Look above the text.** If the paragraph before your line sits inside a quote, or inside a list item, your line may be a lazy continuation. End the quote or item with a blank line.
5. **Check the first line's indent.** Outside lists and quotes, four or more leading spaces on a paragraph's first line make code. Trim them to three or fewer.
6. **Run it through pandoc.** `pandoc -f commonmark -t html plan.md` shows exactly where each `<p>` starts and ends.

## Where Sashmark fits

Work is under way on Sashmark, a desktop app to read and edit the .md files an agent hands back for review. It is in development and has not been released. The app itself has no AI features. Planned for v1: headings, lists and block quotes rendered live, with edits typed straight into that rendered view and untouched lines written back unchanged. The same plan adds a Changes View, which marks each edit made since your last look. Light and dark themes are planned to match the system. Progress is tracked on the [roadmap](/roadmap), the feature set sits under [planned features](/features), and how-to detail is collected in the [help pages](/help).

Updates go up at [sashmark.com](https://www.sashmark.com/).
