Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: avoid including <li> tags in item table short desc #108410

Merged
merged 1 commit into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions tests/rustdoc/item-desc-list-at-start.item-table.html
Original file line number Diff line number Diff line change
@@ -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>
9 changes: 9 additions & 0 deletions tests/rustdoc/item-desc-list-at-start.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @has item_desc_list_at_start/index.html
// @count - '//ul[@class="item-table"]/li/div/li' 0
notriddle marked this conversation as resolved.
Show resolved Hide resolved
// @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;