Skip to content

Commit 34ba77d

Browse files
committed
rustdoc: Do not use Footnotes and HeadingLinks when extracting doc links
they do not add any `Link` events
1 parent 6d819a4 commit 34ba77d

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/librustdoc/html/markdown.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -1275,15 +1275,10 @@ pub(crate) fn markdown_links<R>(
12751275
.map(|link| links.borrow_mut().push(link));
12761276
None
12771277
};
1278-
let p = Parser::new_with_broken_link_callback(md, main_body_opts(), Some(&mut push))
1279-
.into_offset_iter();
12801278

1281-
// There's no need to thread an IdMap through to here because
1282-
// the IDs generated aren't going to be emitted anywhere.
1283-
let mut ids = IdMap::new();
1284-
let iter = Footnotes::new(HeadingLinks::new(p, None, &mut ids, HeadingOffset::H1));
1285-
1286-
for ev in iter {
1279+
for ev in Parser::new_with_broken_link_callback(md, main_body_opts(), Some(&mut push))
1280+
.into_offset_iter()
1281+
{
12871282
if let Event::Start(Tag::Link(
12881283
// `<>` links cannot be intra-doc links so we skip them.
12891284
kind @ (LinkType::Inline

0 commit comments

Comments
 (0)