about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-03-19 18:01:52 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-03-19 18:02:52 +0100
commitd2d15fe60ee88a07cc269fe1b25df670a266cc0c (patch)
treec2a644a5a7fef17e438408771bd636e8dd2d417e
parent2d64f229a09515978e6f338b821057a64334a0b5 (diff)
downloadrust-d2d15fe60ee88a07cc269fe1b25df670a266cc0c.tar.gz
rust-d2d15fe60ee88a07cc269fe1b25df670a266cc0c.zip
Remove footnote references from doc summary
-rw-r--r--src/librustdoc/html/markdown.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index fe446ae3c16..fd81a21f5a9 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -556,7 +556,15 @@ fn check_if_allowed_tag(t: &Tag<'_>) -> bool {
 }
 
 fn is_forbidden_tag(t: &Tag<'_>) -> bool {
-    matches!(t, Tag::CodeBlock(_) | Tag::Table(_) | Tag::TableHead | Tag::TableRow | Tag::TableCell)
+    matches!(
+        t,
+        Tag::CodeBlock(_)
+            | Tag::Table(_)
+            | Tag::TableHead
+            | Tag::TableRow
+            | Tag::TableCell
+            | Tag::FootnoteDefinition(_)
+    )
 }
 
 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> {
                     is_start = false;
                     check_if_allowed_tag(c)
                 }
+                Event::FootnoteReference(_) => {
+                    self.skipped_tags += 1;
+                    false
+                }
                 _ => true,
             };
             if !is_allowed_tag {