#[non_exhaustive]pub enum HtmlPolicy {
Escape,
Safe,
Trusted,
}Expand description
What markstream does with raw HTML in the Markdown (htmlPolicy prop).
The default is HtmlPolicy::Escape. Use it for user input and model
output.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Escape
Show raw HTML as text. The safe default.
Safe
Keep an allowlist of tags and attributes.
Trusted
Keep all raw HTML except <script>. Use only for Markdown that you
wrote. The page head must also hold markstream_allow_trusted().
Without it, the browser uses HtmlPolicy::Safe.
Implementations§
Trait Implementations§
Source§impl Clone for HtmlPolicy
impl Clone for HtmlPolicy
impl Copy for HtmlPolicy
Source§impl Debug for HtmlPolicy
impl Debug for HtmlPolicy
Source§impl Default for HtmlPolicy
impl Default for HtmlPolicy
impl Eq for HtmlPolicy
Source§impl Hash for HtmlPolicy
impl Hash for HtmlPolicy
Source§impl PartialEq for HtmlPolicy
impl PartialEq for HtmlPolicy
impl StructuralPartialEq for HtmlPolicy
Auto Trait Implementations§
impl Forget for HtmlPolicy
impl Freeze for HtmlPolicy
impl RefUnwindSafe for HtmlPolicy
impl Send for HtmlPolicy
impl Sync for HtmlPolicy
impl Unpin for HtmlPolicy
impl UnsafeUnpin for HtmlPolicy
impl UnwindSafe for HtmlPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
Open a deferred
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.