From 2f8645263e5bc4be3ff2e57ac973202ea63b1517 Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Fri, 24 Feb 2023 12:04:24 +0200 Subject: [PATCH] bump html minifier and keep closing tags in minified html --- Cargo.toml | 2 +- src/html/process.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 19deeff..deecbe4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,6 @@ serde_yaml = "0.9.17" swc = "0.245.5" swc_common = "0.29.28" anyhow = "1.0.68" -minify-html = "0.10.7" +minify-html = "0.10.8" lightningcss = "1.0.0-alpha.39" ico = "0.3.0" diff --git a/src/html/process.rs b/src/html/process.rs index 3dfaeef..aab984d 100644 --- a/src/html/process.rs +++ b/src/html/process.rs @@ -8,7 +8,10 @@ use swc_common::{SourceMap, GLOBALS, FileName}; pub fn minify_html(input: String) -> Result { String::from_utf8(minify_html::minify( input.as_bytes(), - &minify_html::Cfg::default() + &minify_html::Cfg { + keep_closing_tags: true, + ..Default::default() + } )).map_err(|e| format!("{e}")) }