use crate::dom::void_tag::VoidTagOptions;
use std::collections::HashMap;
#[derive(Debug, Clone)]
pub struct ZeroCopyTagMatch<'a> {
pub start: usize,
pub end: usize,
pub is_comment: bool,
pub is_closing: bool,
pub tag_name: &'a str,
pub attrs: &'a str,
pub self_closing: bool,
}
#[derive(Debug, Clone)]
pub struct Options {
pub lower_case_tag_name: bool,
pub comment: bool,
pub fix_nested_a_tags: bool,
pub parse_none_closed_tags: bool,
pub preserve_tag_nesting: bool,
pub block_text_elements: HashMap<String, bool>, pub suppress_script_style_text: bool,
pub void_tag: VoidTagOptions,
}
impl Default for Options {
fn default() -> Self {
let mut block = HashMap::new();
block.insert("script".into(), true);
block.insert("style".into(), true);
block.insert("noscript".into(), true);
block.insert("pre".into(), true);
Self {
lower_case_tag_name: false,
comment: false,
fix_nested_a_tags: false,
parse_none_closed_tags: false,
preserve_tag_nesting: false,
block_text_elements: block,
suppress_script_style_text: false,
void_tag: Default::default(),
}
}
}
#[derive(Clone)]
pub(crate) struct StackEntry {
pub elem: Box<crate::dom::element::HTMLElement>,
}