You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 722fad6
Browse filesBrowse the repository at this point in the historyBrowse files
fix(md013): stop exempting a complete link followed by a parenthesized aside
The spaces-in-destination fallback matched any line that starts with a link or
image and ends with one balanced parenthesized group, so a common list entry
such as `- [ripgrep](https://github.com/BurntSushi/ripgrep) (a line-oriented
search tool)` became exempt from the line-length check and `rumdl fmt` stopped
wrapping it.
Two conditions separate a destination from prose. A destination holding a space
does not parse as an inline link at all: the link text degrades to an empty-url
shortcut, which is the state the fallback exists for, while a complete link
carries its own url. And CommonMark forbids whitespace between `]` and `(`, so
a group separated by a space cannot be a destination.
Follow-up to #781.
let rule = MD013LineLength::from_config_struct(config);
9691
+
9692
+
// A complete link or image followed by a parenthesized aside is prose. The line can be
9693
+
// wrapped, so the standalone exemption must not cover it.
9694
+
let reported = [
9695
+
"- [ripgrep](https://github.com/BurntSushi/ripgrep) (a line-oriented search tool that recursively searches)\n",
9696
+
"[the docs](https://example.com/d) (updated for 2026, including the new configuration guide)\n",
9697
+
"[NOTE] (this applies only when the feature flag is enabled and the server runs in cluster mode)\n",
9698
+
" (captured on a retina display at 2x scaling with the sidebar hidden)\n",
9699
+
"[the docs](https://example.com/d)(a parenthetical stuck right onto the end of the link here)\n",
9700
+
];
9701
+
for content in reported {
9702
+
let ctx = LintContext::new(content,MarkdownFlavor::Standard,None);
9703
+
let result = rule.check(&ctx).unwrap();
9704
+
assert_eq!(result.len(),1,"line should be reported: {content:?}");
9705
+
}
9706
+
9707
+
// A destination that genuinely holds a space still exempts the line.
0 commit comments