mirror of
https://github.com/lexmount/moli.git
synced 2026-11-22 00:02:21 +00:00
Share structural classifications with the HTML fallback so authored blocks retain boundaries. Cover adjacent sections and related semantic blocks, and retain the authored center wrappers in the layout fixture.
65 lines
1.5 KiB
Rust
65 lines
1.5 KiB
Rust
pub(crate) fn is_block(tag: &str) -> bool {
|
|
is_structural_block(tag)
|
|
|| matches!(
|
|
tag,
|
|
"audio" | "canvas" | "frameset" | "isindex" | "noframes" | "output"
|
|
)
|
|
}
|
|
|
|
/// These elements already own their document/list/choice boundaries.
|
|
pub(crate) fn owns_boundaries(tag: &str) -> bool {
|
|
is_structural_block(tag) || matches!(tag, "select" | "optgroup" | "option" | "col" | "colgroup")
|
|
}
|
|
|
|
pub(crate) fn is_structural_block(tag: &str) -> bool {
|
|
matches!(
|
|
tag,
|
|
"address"
|
|
| "article"
|
|
| "aside"
|
|
| "blockquote"
|
|
| "body"
|
|
| "caption"
|
|
| "center"
|
|
| "dd"
|
|
| "details"
|
|
| "dialog"
|
|
| "dir"
|
|
| "div"
|
|
| "dl"
|
|
| "dt"
|
|
| "fieldset"
|
|
| "figcaption"
|
|
| "figure"
|
|
| "footer"
|
|
| "form"
|
|
| "h1"
|
|
| "h2"
|
|
| "h3"
|
|
| "h4"
|
|
| "h5"
|
|
| "h6"
|
|
| "header"
|
|
| "hgroup"
|
|
| "html"
|
|
| "legend"
|
|
| "li"
|
|
| "main"
|
|
| "menu"
|
|
| "nav"
|
|
| "ol"
|
|
| "p"
|
|
| "pre"
|
|
| "section"
|
|
| "summary"
|
|
| "table"
|
|
| "tbody"
|
|
| "td"
|
|
| "tfoot"
|
|
| "th"
|
|
| "thead"
|
|
| "tr"
|
|
| "ul"
|
|
)
|
|
}
|