Skip to main content

count_root_elements

Function count_root_elements 

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

Counts the top-level elements in rendered component HTML.

Text, whitespace, comments, and doctypes are ignored, and elements nested inside another element are not counted: "<div></div><div></div>" is 2 while "<div><span></span></div>" is 1.