Skip to content

Commit 422f683

Browse files
rchaser53ytmimi
authored andcommitted
Backport 4042
fix not to break relative path link
1 parent 5ff7b63 commit 422f683

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/string.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ fn detect_url(s: &[&str], index: usize) -> Option<usize> {
169169
|| split.contains("http://")
170170
|| split.contains("ftp://")
171171
|| split.contains("file://")
172+
|| split.contains("./")
172173
{
173174
match s[index..].iter().position(|g| is_whitespace(g)) {
174175
Some(pos) => Some(index + pos - 1),

tests/target/issue-4023.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// rustfmt-max_width: 100
2+
// rustfmt-wrap_comments: true
3+
// rustfmt-comment_width: 80
4+
// rustfmt-normalize_comments: true
5+
// rustfmt-unstable_features: true
6+
7+
/// [`MANAGE_MESSAGES`](../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES)
8+
/// [`MANAGE_CHANNEL`](./permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNEL)
9+
struct Test {
10+
/// [`MANAGE_MESSAGES`]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
11+
/// [`MANAGE_CHANNEL`]: ./permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNEL
12+
#[serde(default, rename = "rate_limit_per_user")]
13+
pub rate_limit: u16,
14+
}

0 commit comments

Comments
 (0)