pub fn is_void_element(name: &str) -> boolExpand description
Returns true if the element is a void element (no closing tag).
Void elements are HTML elements that cannot have content and must not have a closing tag. Per the HTML5 specification, these are:
area,base,br,col,embed,hr,img,inputlink,meta,param,source,track,wbr
ยงExamples
use scrape_core::utils::is_void_element;
assert!(is_void_element("br"));
assert!(is_void_element("img"));
assert!(is_void_element("input"));
assert!(!is_void_element("div"));
assert!(!is_void_element("span"));
assert!(!is_void_element("p"));