pub struct SafeHtml;Expand description
Elements and attributes from ammonia’s default whitelist, links and images only with safe
destinations (is_safe_url). Scripts, styles, event handlers, frames, forms
and javascript: addresses don’t get through. Elements outside the whitelist lose just
their tags; <script> and <style> go away together with their content.
Trait Implementations§
impl Copy for SafeHtml
Source§impl HtmlPolicy for SafeHtml
impl HtmlPolicy for SafeHtml
Source§fn element(&self, name: &str) -> ElementAction
fn element(&self, name: &str) -> ElementAction
What happens to an element of raw HTML. The name is lowercase.
Source§fn attribute<'v>(
&self,
element: &str,
name: &str,
value: &'v str,
) -> Option<Cow<'v, str>>
fn attribute<'v>( &self, element: &str, name: &str, value: &'v str, ) -> Option<Cow<'v, str>>
The value an attribute of a kept element gets — the same one or changed —
or
None, which drops the attribute. Names are lowercase and character references
in values are already resolved (j is j).Auto Trait Implementations§
impl Freeze for SafeHtml
impl RefUnwindSafe for SafeHtml
impl Send for SafeHtml
impl Sync for SafeHtml
impl Unpin for SafeHtml
impl UnsafeUnpin for SafeHtml
impl UnwindSafe for SafeHtml
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