Skip to content

Commit da90fd5

Browse files
authored
Rollup merge of rust-lang#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
2 parents 7c562ee + 5a9a3df commit da90fd5

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/librustdoc/html/markdown.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> SummaryLine<'a, I> {
552552
}
553553

554554
fn check_if_allowed_tag(t: &Tag<'_>) -> bool {
555-
matches!(
556-
t,
557-
Tag::Paragraph | Tag::Item | Tag::Emphasis | Tag::Strong | Tag::Link(..) | Tag::BlockQuote
558-
)
555+
matches!(t, Tag::Paragraph | Tag::Emphasis | Tag::Strong | Tag::Link(..) | Tag::BlockQuote)
559556
}
560557

561558
fn is_forbidden_tag(t: &Tag<'_>) -> bool {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// @has item_desc_list_at_start/index.html
2+
// @count - '//ul[@class="item-table"]/li/div/li' 0
3+
// @count - '//ul[@class="item-table"]/li' 1
4+
// @snapshot item-table - '//ul[@class="item-table"]'
5+
6+
// based on https://docs.rs/gl_constants/0.1.1/src/gl_constants/lib.rs.html#16
7+
8+
/// * Groups: `SamplePatternSGIS`, `SamplePatternEXT`
9+
pub const MY_CONSTANT: usize = 0;

0 commit comments

Comments
 (0)