# Divergences from Prettier
Where tidy's Markdown formatter, with its Prettier preset, differs from prettier@3.9.10 on purpose. Each case is a minimal input run through both. `→` is a tab and `·` is a trailing space. A _meaning_ entry is a place where Prettier's output reads differently from its input; a _layout_ entry is a choice between two outputs that read the same. Gaps that tidy should close, and parser bugs, are in `crates/tidy/src/markdown/handoff.md` instead. The other languages' deviations are in `deviations.md`.
## HTML in a task item keeps its indent
`task-html`. Kind: meaning. Luke's rule: formatting never changes what a document means.
Prettier moves the HTML block to the margin, out of the list item, and indents its later lines past the box: each pass adds 4 more spaces.
Input:
```markdown
- [ ] a
x
y
```
Prettier:
```markdown
- [ ] a
x
y
```
tidy:
```markdown
- [ ] a
x
y
```
## An indented line that would open a block keeps its indent
`continuation`. Kind: meaning. Luke's rule: formatting never changes what a document means.
Without the indent, the fence, thematic break, or HTML tag opens a block and ends the paragraph.
Input:
````markdown
text
```
````
Prettier:
````markdown
text
```
````
tidy:
````markdown
text
```
````
## Link targets stay as written where Prettier's form reads differently
`link-target`. Kind: meaning. Luke's rule: formatting never changes what a document means.
Prettier writes the parsed URL. An unbalanced `(` then ends the link, and a backslash, `<`, `>`, or an entity changes the target.
Input:
```markdown
[a](a\(b)
[c]()
```
Prettier:
```markdown
[a](a(b)
[c]()
```
tidy:
```markdown
[a](a\(b)
[c]()
```
## An emphasis mark right after `*` is `_`
`emphasis`. Kind: meaning. Luke's rule: formatting never changes what a document means.
Prettier writes `*`, which merges into `***` and nests the other way.
Input:
```markdown
x ***_a_*** y
```
Prettier:
```markdown
x _***a***_ y
```
tidy:
```markdown
x _**_a_**_ y
```
## A code span over two lines keeps its second line as written
`code-span`. Kind: meaning. Luke's rule: formatting never changes what a document means.
Prettier writes it from the parsed value, without the container's indent or `>`, so the second line leaves the list item or quote.
Input:
```markdown
- a `x
y` z
```
Prettier:
```markdown
- a `x
y` z
```
tidy:
```markdown
- a `x
y` z
```
## A blank line before a nested list stays when it is all that keeps the list loose
`nested-blank`. Kind: meaning. Luke's rule: formatting never changes what a document means.
Prettier drops a blank line before a nested list after anything but a paragraph or code. When no other blank line keeps the list loose, it turns tight, and its paragraphs lose their ``.
Input:
```markdown
- c
- > q
- b
```
Prettier:
```markdown
- c
- > q
- b
```
tidy:
```markdown
- c
- > q
- b
```
## Filling never starts a line with a tag that opens an HTML block
`wrap-html` (`wrap: always`, width 20). Kind: meaning. Luke's rule: formatting never changes what a document means.
Prettier breaks before `
`, `