Function extract_paragraph_body

Source
pub fn extract_paragraph_body(
    node: AId<Node>,
    keep_if_attributes: bool,
    html: &HtmlAllocator,
) -> Flat<Node>
Expand description

Strip outer div and p HTML elements and return the body of the inner-most of them. E.g. <div><p>Some <b>text</b>.</p></div> becomes Some <b>text</b>.. If not possible, returns the original node. If node is not in html, silently returns the original node. If keep_if_attributes is true, only strips elements when they have no attributes.