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
This commit is contained in:
commit
da90fd5a33
3 changed files with 11 additions and 4 deletions
|
@ -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 {
|
||||
|
|
1
tests/rustdoc/item-desc-list-at-start.item-table.html
Normal file
1
tests/rustdoc/item-desc-list-at-start.item-table.html
Normal file
|
@ -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
tests/rustdoc/item-desc-list-at-start.rs
Normal file
9
tests/rustdoc/item-desc-list-at-start.rs
Normal file
|
@ -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;
|
Loading…
Add table
Reference in a new issue