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>
Source§fn start<'a>(
&self,
tree: Tree<'a>,
file: &mut File,
alloc: &'a Bump,
) -> Result<Step<'a>, Error>
fn start<'a>( &self, tree: Tree<'a>, file: &mut File, alloc: &'a Bump, ) -> Result<Step<'a>, Error>
Start the stage: a finished tree, or a job when its work is asynchronous.
Source§fn host(&self) -> Option<u32>
fn host(&self) -> Option<u32>
The id of the binding function this stage stands for, which takes and returns
whatever tree reaches it;
None for a stage the crate runs.Source§fn html_writer(&self, _target: HtmlTarget) -> Option<Box<dyn HtmlWriter>>
fn html_writer(&self, _target: HtmlTarget) -> Option<Box<dyn HtmlWriter>>
Something that writes, from this stage’s input, the HTML a compiler aiming at
target would write from its output, when the stage can skip building that tree.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