pub(crate) fn is_void(name: &str) -> bool {
matches!(
name,
"area"
| "base"
| "br"
| "col"
| "embed"
| "hr"
| "img"
| "input"
| "link"
| "meta"
| "param"
| "source"
| "track"
| "wbr"
)
}
pub(crate) fn is_raw_text(name: &str) -> bool {
matches!(name, "script" | "style")
}
fn closes_p(name: &str) -> bool {
matches!(
name,
"address"
| "article"
| "aside"
| "blockquote"
| "details"
| "div"
| "dl"
| "fieldset"
| "figcaption"
| "figure"
| "footer"
| "form"
| "h1"
| "h2"
| "h3"
| "h4"
| "h5"
| "h6"
| "header"
| "hgroup"
| "hr"
| "main"
| "menu"
| "nav"
| "ol"
| "p"
| "pre"
| "section"
| "table"
| "ul"
)
}
pub(crate) fn implicitly_closes(opening: &str, open: &str) -> bool {
match open {
"p" => closes_p(opening),
"li" => opening == "li",
"dt" | "dd" => matches!(opening, "dt" | "dd"),
"option" => matches!(opening, "option" | "optgroup"),
"optgroup" => opening == "optgroup",
"td" | "th" => matches!(opening, "td" | "th" | "tr" | "tbody" | "thead" | "tfoot"),
"tr" => matches!(opening, "tr" | "tbody" | "thead" | "tfoot"),
"thead" | "tbody" | "tfoot" => matches!(opening, "tbody" | "thead" | "tfoot"),
_ => false,
}
}