mod node;
mod traversal;
pub use node::*;
pub use traversal::{get_tag_name, has_ancestor_tag};
use dom_query::{Matcher, Node, Selection};
pub fn node_select<'a>(node: &Node<'a>, selector: &str) -> Selection<'a> {
Selection::from(*node).select(selector)
}
pub fn node_select_matcher<'a>(node: &Node<'a>, matcher: &Matcher) -> Selection<'a> {
Selection::from(*node).select_matcher(matcher)
}
pub fn build_match_string(node: &Node<'_>, buf: &mut String) {
buf.clear();
if let Some(class) = node.attr("class") {
buf.push_str(class.as_ref());
}
buf.push(' ');
if let Some(id) = node.attr("id") {
buf.push_str(id.as_ref());
}
}