Skip to content

Commit d2d15fe

Browse files
Remove footnote references from doc summary
1 parent 2d64f22 commit d2d15fe

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/librustdoc/html/markdown.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,15 @@ fn check_if_allowed_tag(t: &Tag<'_>) -> bool {
556556
}
557557

558558
fn is_forbidden_tag(t: &Tag<'_>) -> bool {
559-
matches!(t, Tag::CodeBlock(_) | Tag::Table(_) | Tag::TableHead | Tag::TableRow | Tag::TableCell)
559+
matches!(
560+
t,
561+
Tag::CodeBlock(_)
562+
| Tag::Table(_)
563+
| Tag::TableHead
564+
| Tag::TableRow
565+
| Tag::TableCell
566+
| Tag::FootnoteDefinition(_)
567+
)
560568
}
561569

562570
impl<'a, I: Iterator<Item = Event<'a>>> Iterator for SummaryLine<'a, I> {
@@ -589,6 +597,10 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for SummaryLine<'a, I> {
589597
is_start = false;
590598
check_if_allowed_tag(c)
591599
}
600+
Event::FootnoteReference(_) => {
601+
self.skipped_tags += 1;
602+
false
603+
}
592604
_ => true,
593605
};
594606
if !is_allowed_tag {

0 commit comments

Comments
 (0)