diff --git a/src/string.rs b/src/string.rs index b65aa5b33b2..a8ded0f2379 100644 --- a/src/string.rs +++ b/src/string.rs @@ -169,6 +169,7 @@ fn detect_url(s: &[&str], index: usize) -> Option { || split.contains("http://") || split.contains("ftp://") || split.contains("file://") + || split.contains("./") { match s[index..].iter().position(|g| is_whitespace(g)) { Some(pos) => Some(index + pos - 1), diff --git a/tests/target/issue-4023.rs b/tests/target/issue-4023.rs new file mode 100644 index 00000000000..702ef33c633 --- /dev/null +++ b/tests/target/issue-4023.rs @@ -0,0 +1,14 @@ +// rustfmt-max_width: 100 +// rustfmt-wrap_comments: true +// rustfmt-comment_width: 80 +// rustfmt-normalize_comments: true +// rustfmt-unstable_features: true + +/// [`MANAGE_MESSAGES`](../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES) +/// [`MANAGE_CHANNEL`](./permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNEL) +struct Test { + /// [`MANAGE_MESSAGES`]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES + /// [`MANAGE_CHANNEL`]: ./permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNEL + #[serde(default, rename = "rate_limit_per_user")] + pub rate_limit: u16, +}