# Divergences from Prettier Where mdtidy's 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 mdtidy should close, and parser bugs, are in `handoff.md` instead. ## 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
```` mdtidy: ````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 ``` ```` mdtidy: ````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]() ```` mdtidy: ````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 ```` mdtidy: ````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 ```` mdtidy: ````markdown - a `x y` z ```` ## A blank line before a nested list stays when it is all that keeps the item loose `nested-blank`. Kind: layout. Not signed off yet: ask Luke. Prettier drops it and adds one after the item's first line instead. Both read the same; mdtidy keeps the source's choice. Input: ````markdown - a > q - b ```` Prettier: ````markdown - a > q - b ```` mdtidy: ````markdown - a > q - b ```` ## With `wrap: never`, the line after a hard break in a footnote keeps its indent `footnote-never` (`wrap: never`, width 80). Kind: layout. Not signed off yet: ask Luke. Prettier drops the indent. It reads the same as a lazy line, but worse. Input: ````markdown [^1]: one\ two ```` Prettier: ````markdown [^1]: one\ two ```` mdtidy: ````markdown [^1]: one\ two ```` ## 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 `
`, `