Jelajahi Sumber

don't replace new lines with whitespaces

Gildas 7 tahun lalu
induk
melakukan
6481b6d1c5
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      lib/single-file/html-minifier.js

+ 1 - 1
lib/single-file/html-minifier.js

@@ -199,7 +199,7 @@ this.htmlmini = this.htmlmini || (() => {
 				noWhitespace = element && noWhitespaceCollapse(element);
 			}
 			if ((!element || noWhitespace) && textContent.length > 1) {
-				node.textContent = textContent.replace(REGEXP_WHITESPACE, getWhiteSpace(node)).replace(REGEXP_NEWLINE, getWhiteSpace(node));
+				node.textContent = textContent.replace(REGEXP_WHITESPACE, getWhiteSpace(node)).replace(REGEXP_NEWLINE, "\n");
 			}
 		}
 	}