Skip to content

Markdown: text after a colon in [[...|label]] is silently deleted (regression in 3.9.0) #19551

Description

@loxy

Prettier 3.9.4 (regression introduced in 3.9.0; last good version 3.8.5)

Playground link

# Options (if any):
--parser markdown

Input:

- [[slug|Label: with colon]]
- [[slug|A: B: C]]
- [[slug|Label with no colon]]
- [text|Label: with colon]

Output:

- [[slug|Label]]
- [[slug|A]]
- [[slug|Label with no colon]]
- [text|Label: with colon]

Expected output:

- [[slug|Label: with colon]]
- [[slug|A: B: C]]
- [[slug|Label with no colon]]
- [text|Label: with colon]

Why?

Text content after the first : inside a [[...|...]] is silently deleted — this is content loss, not reformatting, and Prettier should never change a document's content. This regressed in 3.9.0 (3.8.5 leaves the input untouched).

The trigger is specific to the double-bracket form: CommonMark parses [[a]] as a shortcut reference link nested inside another link, and the colon in the label triggers the drop. A single-bracket [text|Label: with colon] and a colon-free [[slug|Label]] are both left intact — so it's the [[...]] + : combination. This [[target|Alias: description]] shape is standard Obsidian/wiki-link syntax, so prettier --write silently strips the descriptive half of every such cross-reference in a docs vault.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions