diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-02-19 14:47:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-19 14:47:55 +0100 |
| commit | bd63edc07aad0c3fa7300505cf45bacb6bfb650f (patch) | |
| tree | 87a2f833eeb71aafa899ae311952082a9c7d0a0e /compiler/rustc_resolve/src/rustdoc.rs | |
| parent | 49d7ed1dbef6744cd9a27fdae086c9b80fb4ed46 (diff) | |
| parent | 8d801fd3983d83ee701beb35b86d3d5b6540890e (diff) | |
| download | rust-bd63edc07aad0c3fa7300505cf45bacb6bfb650f.tar.gz rust-bd63edc07aad0c3fa7300505cf45bacb6bfb650f.zip | |
Rollup merge of #108129 - GuillaumeGomez:correctly-handle-links-starting-with-whitespace, r=petrochenkov
Correctly handle links starting with whitespace Part of https://github.com/rust-lang/rust/issues/107995. I just got this issue, wrote a fix and then saw the issue. So here's the PR. ^^' r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_resolve/src/rustdoc.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/rustdoc.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/rustdoc.rs b/compiler/rustc_resolve/src/rustdoc.rs index 0c4b4bc3f62..5e4b66018e4 100644 --- a/compiler/rustc_resolve/src/rustdoc.rs +++ b/compiler/rustc_resolve/src/rustdoc.rs @@ -339,6 +339,7 @@ pub fn inner_docs(attrs: &[ast::Attribute]) -> bool { fn preprocess_link(link: &str) -> String { let link = link.replace('`', ""); let link = link.split('#').next().unwrap(); + let link = link.trim(); let link = link.rsplit('@').next().unwrap(); let link = link.strip_suffix("()").unwrap_or(link); let link = link.strip_suffix("{}").unwrap_or(link); |
