Describe the bug
dprint-plugin-markdown version: 0.21.1
The formatter removes functional angle brackets (< >) from inline Markdown links. While this simplifies the syntax for basic URLs, it breaks links that contain spaces, parentheses, and ASCII control characters. According to the CommonMark specification (Section 6.3), angle brackets are the standard method for protecting complex URIs. Stripping them results in invalid Markdown that modern parsers - including those used by GitHub, VS Code, and Obsidian - cannot navigate.
Input Code
[Scratch](<00 Top/001 Scratch.md>)
[Note](<Folder/File (Draft).md>)
Expected Output
The brackets should be preserved to maintain link integrity:
[Scratch](<00 Top/001 Scratch.md>)
[Note](<Folder/File (Draft).md>)
Actual Output
The brackets are stripped, breaking the links in most parsers:
[Scratch](00 Top/001 Scratch.md)
[Note](Folder/File (Draft).md)
Suggested Options
I suggest, as an opinionated default, preserve the angle brackets if they exist, rather than strip them.
A more comprehensive solution could be a new configuration option, such as linkDestinationStyle, to give users control over this behaviour:
- maintain (default): Leave angle brackets exactly as the author wrote them.
- always: Automatically add angle brackets all link destinations for consistency and robustness.
- optimal: Strip brackets only if the path contains no spaces or special characters.
- remove: Strip all angle brackets around link destinations.
Describe the bug
dprint-plugin-markdown version: 0.21.1
The formatter removes functional angle brackets (
< >) from inline Markdown links. While this simplifies the syntax for basic URLs, it breaks links that contain spaces, parentheses, and ASCII control characters. According to the CommonMark specification (Section 6.3), angle brackets are the standard method for protecting complex URIs. Stripping them results in invalid Markdown that modern parsers - including those used by GitHub, VS Code, and Obsidian - cannot navigate.Input Code
Expected Output
The brackets should be preserved to maintain link integrity:
Actual Output
The brackets are stripped, breaking the links in most parsers:
Suggested Options
I suggest, as an opinionated default, preserve the angle brackets if they exist, rather than strip them.
A more comprehensive solution could be a new configuration option, such as
linkDestinationStyle, to give users control over this behaviour: