Escaped links/images lose escaping after formatting
Author: emmatownCreated Oct 28, 2025Updated Jul 6, 2026
Labelsbug
What happened?
Formatting markdoc like \[a](https://example.com) formats to [a](https://example.com). It removes the escaping when it should preserve it.
To reproduce
For all of these examples, when rendered, they correctly render the escaped content
\[a](https://example.com)
\!\[a](https://example.com)
\<https://example.com>When passed through Markdoc.format though, the result is
[a](https://example.com)

<https://example.com>with the escaping removed which shouldn't happen
Version
0.5.4
Additional context
No response
Source: markdoc/markdoc