Rollup merge of #82962 - notriddle:cleanup-index, r=jyn514
Treat header as first paragraph for shortened markdown descriptions "The Rust Standard LibraryThe Rust Standard Library is the …" is an awful description.
This commit is contained in:
commit
5c62a182a1
@ -1093,6 +1093,7 @@ fn push(s: &mut String, text_length: &mut usize, text: &str) {
|
||||
Tag::Emphasis => s.push_str("</em>"),
|
||||
Tag::Strong => s.push_str("</strong>"),
|
||||
Tag::Paragraph => break,
|
||||
Tag::Heading(..) => break,
|
||||
_ => {}
|
||||
},
|
||||
Event::HardBreak | Event::SoftBreak => {
|
||||
|
@ -235,6 +235,7 @@ fn t(input: &str, expect: &str) {
|
||||
t("code `let x = i32;` ...", "code <code>let x = i32;</code> …");
|
||||
t("type `Type<'static>` ...", "type <code>Type<'static></code> …");
|
||||
t("# top header", "top header");
|
||||
t("# top header\n\nfollowed by a paragraph", "top header");
|
||||
t("## header", "header");
|
||||
t("first paragraph\n\nsecond paragraph", "first paragraph");
|
||||
t("```\nfn main() {}\n```", "");
|
||||
|
@ -286,11 +286,7 @@ fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
let mut seq = serializer.serialize_seq(None)?;
|
||||
seq.serialize_element(&self.ty.name)?;
|
||||
let x: ItemType = self.kind.into();
|
||||
seq.serialize_element(&x)?;
|
||||
seq.end()
|
||||
(&self.ty.name, ItemType::from(self.kind)).serialize(serializer)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user