Use only direct childs of #main for description
Some elements, for example std::io::ErrorKind, have nested docblocks in their type-decl docblock. This would lead to a wrong description because we pick the first non-type-decl docblock for the description. With this patch, we require that the description docblock is a direct child of #main to fix this issue.
This commit is contained in:
parent
f799d860ca
commit
9f0497932f
@ -80,7 +80,7 @@ pub fn parse_item_doc<P: AsRef<path::Path>>(path: P, name: &doc::Fqn) -> anyhow:
|
||||
let document = parse_file(path)?;
|
||||
let heading = select_first(&document, ".fqn .in-band")?.context("Could not find heading")?;
|
||||
let definition = select_first(&document, ".docblock.type-decl")?;
|
||||
let description = select_first(&document, ".docblock:not(.type-decl)")?;
|
||||
let description = select_first(&document, "#main > .docblock:not(.type-decl)")?;
|
||||
|
||||
let mut doc = doc::Doc::new(name.clone());
|
||||
doc.title = Some(get_html(heading.as_node())?);
|
||||
|
Loading…
Reference in New Issue
Block a user