Struct minify_html::Cfg[][src]

pub struct Cfg {
    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 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.

minify_css: bool

If enabled, CSS in <style> tags are minified using esbuild-rs. The js-esbuild feature must be enabled; otherwise, this value has no effect.

minify_js: bool

If enabled, JavaScript in <script> tags are minified using esbuild-rs. The js-esbuild feature must be enabled; otherwise, this value has no effect.

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

Trait Implementations

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.