Skip to main content

page_h1_text

Function page_h1_text 

Source
pub fn page_h1_text(html: &str) -> Option<String>
Expand description

Extract the collapsed text of the page’s primary <h1> heading.

rustdoc renders an item page heading as e.g. <h1>Struct serde_json::Value</h1> (the item kind plus the fully-qualified path) and a crate landing page as <h1>Crate serde</h1>. Returns the whitespace-collapsed text of the first <h1> inside the main content area (falling back to any <h1>), or None when the page has no heading.