diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-25 11:31:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-25 11:31:34 +0100 |
| commit | da90fd5a339f565fc1f7d57941e9101100fc0a7b (patch) | |
| tree | c1cb324bbcc888e96b532334ceaf6c7048c14bf5 | |
| parent | 7c562ee5a62a95dc7b459b742b6eb1fbecd4fe7f (diff) | |
| parent | 5a9a3df3125b13de25ba7d0c91efebf82e94c3f9 (diff) | |
| download | rust-da90fd5a339f565fc1f7d57941e9101100fc0a7b.tar.gz rust-da90fd5a339f565fc1f7d57941e9101100fc0a7b.zip | |
Rollup merge of #108410 - notriddle:notriddle/tag-item-summary, r=GuillaumeGomez
rustdoc: avoid including `<li>` tags in item table short desc Fixes a bug seen at https://docs.rs/gl_constants/0.1.1/gl_constants/index.html
| -rw-r--r-- | src/librustdoc/html/markdown.rs | 5 | ||||
| -rw-r--r-- | tests/rustdoc/item-desc-list-at-start.item-table.html | 1 | ||||
| -rw-r--r-- | tests/rustdoc/item-desc-list-at-start.rs | 9 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 9ef0b501c08..89f1ad71134 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -552,10 +552,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> SummaryLine<'a, I> { } fn check_if_allowed_tag(t: &Tag<'_>) -> bool { - matches!( - t, - Tag::Paragraph | Tag::Item | Tag::Emphasis | Tag::Strong | Tag::Link(..) | Tag::BlockQuote - ) + matches!(t, Tag::Paragraph | Tag::Emphasis | Tag::Strong | Tag::Link(..) | Tag::BlockQuote) } fn is_forbidden_tag(t: &Tag<'_>) -> bool { diff --git a/tests/rustdoc/item-desc-list-at-start.item-table.html b/tests/rustdoc/item-desc-list-at-start.item-table.html new file mode 100644 index 00000000000..72bde573cea --- /dev/null +++ b/tests/rustdoc/item-desc-list-at-start.item-table.html @@ -0,0 +1 @@ +<ul class="item-table"><li><div class="item-name"><a class="constant" href="constant.MY_CONSTANT.html" title="constant item_desc_list_at_start::MY_CONSTANT">MY_CONSTANT</a></div><div class="desc docblock-short">Groups: <code>SamplePatternSGIS</code>, <code>SamplePatternEXT</code></div></li></ul> \ No newline at end of file diff --git a/tests/rustdoc/item-desc-list-at-start.rs b/tests/rustdoc/item-desc-list-at-start.rs new file mode 100644 index 00000000000..d88c61d333e --- /dev/null +++ b/tests/rustdoc/item-desc-list-at-start.rs @@ -0,0 +1,9 @@ +// @has item_desc_list_at_start/index.html +// @count - '//ul[@class="item-table"]/li/div/li' 0 +// @count - '//ul[@class="item-table"]/li' 1 +// @snapshot item-table - '//ul[@class="item-table"]' + +// based on https://docs.rs/gl_constants/0.1.1/src/gl_constants/lib.rs.html#16 + +/// * Groups: `SamplePatternSGIS`, `SamplePatternEXT` +pub const MY_CONSTANT: usize = 0; |
