Add spec-compliant unquoted attr values option

This commit is contained in:
Wilson Lin 2021-08-08 01:45:25 +10:00
commit 0b58853999
12 changed files with 125 additions and 4 deletions

View file

@ -24,6 +24,8 @@ struct Cli {
/// Minify CSS in `<style>` tags and `style` attributes.
#[structopt(long)]
minify_css: bool,
/// Ensure all unquoted attribute values in the output do not contain any characters prohibited by the WHATWG specification.
pub ensure_spec_compliant_unquoted_attribute_values: bool,
/// Do not omit closing tags when possible.
#[structopt(long)]
keep_closing_tags: bool,
@ -71,6 +73,7 @@ fn main() {
let out_code = minify(
&src_code,
&Cfg {
ensure_spec_compliant_unquoted_attribute_values: args.ensure_spec_compliant_unquoted_attribute_values,
keep_closing_tags: args.keep_closing_tags,
keep_comments: args.keep_comments,
keep_html_and_head_opening_tags: args.keep_html_and_head_opening_tags,