pub struct Sanitize {
pub allow_comments: Option<bool>,
pub allow_doctypes: Option<bool>,
pub ancestors: Option<HashMap<String, Vec<String>>>,
pub attributes: Option<HashMap<String, Vec<AttributeDefinition>>>,
pub clobber: Option<Vec<String>>,
pub clobber_prefix: Option<String>,
pub protocols: Option<HashMap<String, Vec<String>>>,
pub required: Option<HashMap<String, BTreeMap<String, Primitive>>>,
pub strip: Option<Vec<String>>,
pub tag_names: Option<Vec<String>>,
}Expand description
html.sanitize: keep only what a schema allows; options: hast-util-sanitize’s schema,
where a field left out keeps the default schema’s, which is GitHub’s.
Fields§
§allow_comments: Option<bool>Keep comments.
allow_doctypes: Option<bool>Keep doctypes.
ancestors: Option<HashMap<String, Vec<String>>>Elements allowed only inside one of these ancestors, by tag name.
attributes: Option<HashMap<String, Vec<AttributeDefinition>>>Properties allowed per tag name, * for every element; a list names a property and
the values it may have.
clobber: Option<Vec<String>>Properties whose values get clobber_prefix, so they cannot clobber globals.
clobber_prefix: Option<String>The prefix of clobbered values.
protocols: Option<HashMap<String, Vec<String>>>URL properties and the protocols they may use.
required: Option<HashMap<String, BTreeMap<String, Primitive>>>Properties set on elements whatever they had, by tag name.
strip: Option<Vec<String>>Elements dropped with their content rather than unwrapped.
tag_names: Option<Vec<String>>The elements kept.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sanitize
impl<'de> Deserialize<'de> for Sanitize
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Transform for Sanitize
impl Transform for Sanitize
fn input(&self) -> TreeKind
fn output(&self) -> TreeKind
fn run<'a>( &self, tree: Tree<'a>, _file: &mut File, alloc: &'a Allocator, ) -> Result<Tree<'a>, Error>
Auto Trait Implementations§
impl Freeze for Sanitize
impl RefUnwindSafe for Sanitize
impl Send for Sanitize
impl Sync for Sanitize
impl Unpin for Sanitize
impl UnsafeUnpin for Sanitize
impl UnwindSafe for Sanitize
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more