Skip to main content

max_nesting_depth

Function max_nesting_depth 

Source
pub fn max_nesting_depth(html: &str) -> usize
Expand description

Estimate a document’s maximum element nesting depth.

A tag scan, not a parse — the whole point is to answer before paying for a parse. It ignores the implicit closes a real parser performs (<p> inside <p>, unclosed <li>), so it can over-estimate on sloppy markup; that is the safe direction only because the limit sits so far above real documents.