Struct minify_html::Cfg

source ·
pub struct Cfg {
Show 14 fields pub do_not_minify_doctype: bool, pub ensure_spec_compliant_unquoted_attribute_values: bool, pub keep_closing_tags: bool, pub keep_html_and_head_opening_tags: bool, pub keep_spaces_between_attributes: bool, pub keep_comments: bool, pub keep_input_type_text_attr: bool, pub keep_ssi_comments: bool, pub preserve_brace_template_syntax: bool, pub preserve_chevron_percent_template_syntax: bool, pub minify_css: bool, pub minify_js: bool, pub remove_bangs: bool, pub remove_processing_instructions: bool,
}
Expand description

Configuration settings that can be adjusted and passed to a minification function to change the minification approach.

Fields§

§do_not_minify_doctype: bool

Do not minify DOCTYPEs. Minified DOCTYPEs may not be spec compliant.

§ensure_spec_compliant_unquoted_attribute_values: bool

Ensure all unquoted attribute values in the output do not contain any characters prohibited by the WHATWG specification.

§keep_closing_tags: bool

Do not omit closing tags when possible.

§keep_html_and_head_opening_tags: bool

Do not omit <html> and <head> opening tags when they don’t have attributes.

§keep_spaces_between_attributes: bool

Keep spaces between attributes when possible to conform to HTML standards.

§keep_comments: bool

Keep all comments.

§keep_input_type_text_attr: bool

Keep type=text attribute name and value on <input> elements.

§keep_ssi_comments: bool

Keep SSI comments.

§preserve_brace_template_syntax: bool

When {{, {#, or {% are seen in content, all source code until the subsequent matching closing }}, #}, or %} respectively gets piped through untouched.

§preserve_chevron_percent_template_syntax: bool

When <% is seen in content, all source code until the subsequent matching closing %> gets piped through untouched.

§minify_css: bool

Minify CSS in <style> tags and style attributes using https://github.com/parcel-bundler/lightningcss.

§minify_js: bool

Minify JavaScript in <script> tags using minify-js.

Only <script> tags with a valid or no MIME type is considered to contain JavaScript, as per the specification.

§remove_bangs: bool

Remove all bangs.

§remove_processing_instructions: bool

Remove all processing_instructions.

Implementations§

source§

impl Cfg

source

pub fn new() -> Cfg

source

pub fn spec_compliant() -> Cfg

Trait Implementations§

source§

impl Clone for Cfg

source§

fn clone(&self) -> Cfg

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Cfg

source§

fn default() -> Cfg

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Cfg

§

impl Send for Cfg

§

impl Sync for Cfg

§

impl Unpin for Cfg

§

impl UnwindSafe for Cfg

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.