فهرست منبع

perf(processor): minify content even further

There is no need to keep comments (conditionals or not, as IE isn't a thing
anymore), nor default attribute values.
Julien Voisin 9 ماه پیش
والد
کامیت
2b26a345cd
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      internal/reader/processor/utils.go

+ 5 - 2
internal/reader/processor/utils.go

@@ -61,8 +61,11 @@ func minifyContent(content string) string {
 
 	// Options required to avoid breaking the HTML content.
 	m.Add("text/html", &html.Minifier{
-		KeepEndTags: true,
-		KeepQuotes:  true,
+		KeepEndTags:         true,
+		KeepQuotes:          true,
+		KeepComments:        false,
+		KeepSpecialComments: false,
+		KeepDefaultAttrVals: false,
 	})
 
 	if minifiedHTML, err := m.String("text/html", content); err == nil {