Explorar el Código

fixed whitespace collapsing

Gildas hace 7 años
padre
commit
4d76f92b74
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      lib/single-file/htmlmini.js

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

@@ -197,8 +197,7 @@ this.htmlmini = this.htmlmini || (() => {
 				noWhitespace = element && noWhitespaceCollapse(element);
 			}
 			if ((!element || noWhitespace) && textContent.length > 1) {
-				node.textContent = textContent.replace(/[ \t\f\r]+/g, getWhiteSpace(node));
-				node.textContent = textContent.replace(/[\n]+/g, getWhiteSpace(node));
+				node.textContent = textContent.replace(/[ \t\f\r]+/g, getWhiteSpace(node)).replace(/[\n]+/g, getWhiteSpace(node));
 			}
 		}
 	}