mdx-formatter

Type to search...

to open search from anywhere

tighten-list-continuations

Collapse unwanted blank lines inside a list item whose children are continuation paragraphs

Collapse the blank line between two adjacent paragraph children of a list item when heuristics indicate the second paragraph is a continuation of the first sentence — the shape AI authors sometimes emit when wrapping long bullet items.

Modes

ValueDefaultBehavior
"off"Never collapse. Output is byte-identical to the input for this rule.
"heuristic"Collapse only when (a) the item’s children are paragraphs only, (b) they are separated by exactly one blank line at continuation indent, and (c) the second paragraph starts with a continuation signal (lowercase letter, backtick, (, [, ", ', ,, en-dash, em-dash) — except when the second paragraph’s first line matches the shape key: value (an identifier followed by a colon, required whitespace, and a non-empty value), in which case the blank line is always preserved regardless of signal (c).
"aggressive"Drop trigger (c); collapse any paragraphs-only list item whose paragraphs are separated by exactly one blank line.

Config

{
  "tighten-list-continuations": "heuristic"
}

This key sits at the top level of the config — not nested under an object. See the Options overview for the list-normalize section.

Example

Before:

- No `candle`, `ort` / ONNX Runtime, `llama.cpp` / `llama-cpp-2`, `tch` / libtorch, or

  `rust-bert` dependency in `tauri-app/Cargo.toml` or `tauri-app/core/Cargo.toml`.
- No `gguf` / `.onnx` / `.safetensors` assets in the repo.

After ("heuristic" — default):

- No `candle`, `ort` / ONNX Runtime, `llama.cpp` / `llama-cpp-2`, `tch` / libtorch, or
  `rust-bert` dependency in `tauri-app/Cargo.toml` or `tauri-app/core/Cargo.toml`.
- No `gguf` / `.onnx` / `.safetensors` assets in the repo.

The second paragraph starts with ` (inline code), which is a heuristic continuation signal — the blank gap is collapsed.

Key
metadata paragraph is preserved

A continuation paragraph whose first line matches the shape identifier: value is treated as metadata and is always preserved in "heuristic" mode, even though it starts with a lowercase letter.

Before:

- [ ] Fix critical crash #dev

  priority: urgent
  App crashes on launch for iOS 17 users.
- [ ] Security patch #dev

  priority: high
  Update authentication tokens before expiry.

After ("heuristic" — default):

- [ ] Fix critical crash #dev

  priority: urgent
  App crashes on launch for iOS 17 users.
- [ ] Security patch #dev

  priority: high
  Update authentication tokens before expiry.

Output is byte-identical — the blank line before priority: urgent and priority: high is kept because those paragraphs start with a key: value-shaped line.

In "aggressive" mode the blank gaps collapse regardless of the key

shape.

Tradeoffs and scope

The key

guard matches any line of the form word: non-empty-value, so it preserves some prose lines that happen to share that shape:

  • Note: see below — preserved (deliberate tradeoff; this shape is rare enough and the false-preserve is harmless).
  • key: with an empty value — not matched; the blank line is still collapsed (requires non-empty value after the colon).
  • https://example.comnot matched; the colon is immediately followed by // with no space, so the required-whitespace rule excludes URLs.

Capital-initial continuation is left alone

Before:

- first item that intros a follow-up topic.

  Also, this is a new sentence but starts with a capital word.

Output in "heuristic" mode is byte-identical — the capital start suggests a deliberate new topic, not a continuation.

In "aggressive" mode the blank gap collapses regardless.

Notes

  • The rule runs before wrap-markdown in the formatter pipeline, and after the three recover-escaped-* rules. See rule ordering.
  • The rule is idempotent — running the formatter twice on the tightened output produces no further change.
  • Sublists and fenced code children disqualify an item from collapsing in both modes.

Revision History