From f4ce0458e97996ac8b1bad5406ddfd9cd2385a2a Mon Sep 17 00:00:00 2001 From: Lukas Markeffsky <@> Date: Sun, 21 May 2023 18:00:11 +0200 Subject: [PATCH] rustdoc: include strikethrough in item summary --- src/librustdoc/html/markdown.rs | 10 +++++++++- tests/rustdoc/strikethrough-in-summary.rs | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/rustdoc/strikethrough-in-summary.rs diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index c9957e8e39c8..09e7ed293d47 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -551,7 +551,15 @@ impl<'a, I: Iterator>> SummaryLine<'a, I> { } fn check_if_allowed_tag(t: &Tag<'_>) -> bool { - matches!(t, Tag::Paragraph | Tag::Emphasis | Tag::Strong | Tag::Link(..) | Tag::BlockQuote) + matches!( + t, + Tag::Paragraph + | Tag::Emphasis + | Tag::Strong + | Tag::Strikethrough + | Tag::Link(..) + | Tag::BlockQuote + ) } fn is_forbidden_tag(t: &Tag<'_>) -> bool { diff --git a/tests/rustdoc/strikethrough-in-summary.rs b/tests/rustdoc/strikethrough-in-summary.rs new file mode 100644 index 000000000000..cb6cd0e7ba64 --- /dev/null +++ b/tests/rustdoc/strikethrough-in-summary.rs @@ -0,0 +1,6 @@ +#![crate_name = "foo"] + +// @has foo/index.html '//del' 'strike' + +/// ~~strike~~ +pub fn strike() {}