File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -1018,16 +1018,11 @@ fn preprocess_link(
10181018 if ignore_urllike && should_ignore_link ( path_str) {
10191019 return None ;
10201020 }
1021- // Ignore GitHub-flavored Markdown (GFM) admonitions, such as [!NOTE] and [!IMPORTANT]
1021+ // If we have an intra-doc link starting with `!` (which isn't `[!]` because this is the never type), we ignore it
1022+ // as it is never valid.
10221023 //
1023- // rustdoc does not support GFM,
1024- // however it is a common pattern to add `#[doc = include_str!("../README.md")]` to the root of a crate,
1025- // so we want to at least accept GFM, even if it doesn't render perfectly.
1026- //
1027- // We make sure to allow `[!]` as a link to the never type by checking length.
1028- //
1029- // This will never cause us to ignore something that is a valid intra-doc link,
1030- // as (with the exception of `[!]`), intra-doc links can never start with `!`.
1024+ // The case is common enough because of cases like `#[doc = include_str!("../README.md")]` which often
1025+ // uses GitHub-flavored Markdown (GFM) admonitions, such as `[!NOTE]`.
10311026 if is_shortcut_style
10321027 && let Some ( suffix) = ori_link. link . strip_prefix ( '!' )
10331028 && !suffix. is_empty ( )
You can’t perform that action at this time.
0 commit comments