visdom 1.0.4

A html document syntax and operation library, use APIs similar to jquery, easy to use for web scraping and confused html.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::mesdoc::constants::{NAME_SELECTOR_ALL, PRIORITY_ALL_SELECTOR};
use crate::mesdoc::interface::Elements;
use crate::mesdoc::selector::rule::{Matcher, RuleDefItem, RuleItem};
/// selector: `*`
pub fn init(rules: &mut Vec<RuleItem>) {
	let rule: RuleItem = RuleDefItem(
		NAME_SELECTOR_ALL,
		"*",
		PRIORITY_ALL_SELECTOR,
		Box::new(|_| Matcher {
			all_handle: Some(Box::new(|eles: &Elements, _| eles.cloned())),
			..Default::default()
		}),
	)
	.into();
	rules.push(rule);
}