[−][src]Enum lol_html::html_content::TextType
A type of parsed text.
Parsing context adds certain limitations for the textual content. E.g., it's unsafe to
rewrite text inside <script>
element with a string that contains "</script>"
substring as
this will preemptively close the <script>
element, possibly introducing an XSS attack vector.
As other example, some parsing contexts don't allow HTML entities in text. Thus, rewriting
content of a <style>
element with text that contains HTML entities may cause a CSS parsing
error in a browser, because entities won't be decoded by a browser in this context.
Text type provides users of the rewriter with a capability to assess the context in which text parsing is hapenning and make informed decision about preprocessing of the textual content replacement.
The names of the text types are taken from the HTML parsing specification.
Variants
Text inside a <plaintext>
element.
Text inside <title>
and <textarea>
elements.
Text inside <style>
, <xmp>
, <iframe>
, <noembed>
, <noframes>
and
<noscript>
elements.
Text inside a <script>
element.
Regular text.
Text inside a CDATA section.
Methods
impl TextType
[src]
pub fn allows_html_entities(self) -> bool
[src]
Trait Implementations
impl Clone for TextType
[src]
impl Copy for TextType
[src]
impl Debug for TextType
[src]
impl PartialEq<TextType> for TextType
[src]
impl StructuralPartialEq for TextType
[src]
Auto Trait Implementations
impl RefUnwindSafe for TextType
impl Send for TextType
impl Sync for TextType
impl Unpin for TextType
impl UnwindSafe for TextType
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,