Explorar o código

better space compression

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
0cdd75be23
Modificáronse 1 ficheiros con 1 adicións e 5 borrados
  1. 1 5
      lib/single-file/htmlmini.js

+ 1 - 5
lib/single-file/htmlmini.js

@@ -171,11 +171,7 @@ this.htmlmini = this.htmlmini || (() => {
 				let lastTextContent;
 				while (lastTextContent != textContent) {
 					lastTextContent = textContent;
-					textContent = textContent.replace(/ +/g, " ");
-					textContent = textContent.replace(/\n+/g, "\n");
-					textContent = textContent.replace(/\t+/g, "\t");
-					textContent = textContent.replace(/\f+/g, "\f");
-					textContent = textContent.replace(/\r+/g, "\r");
+					textContent = textContent.replace(/[ \n\t\f\r]+/g, " ");
 				}
 				node.textContent = textContent;
 			}