keep   nodes in HTML templates

This commit is contained in:
tophf 2020-11-16 19:56:32 +03:00
parent 57111e51fc
commit 8473053d79

View File

@ -90,7 +90,7 @@ Object.assign(t, {
const toRemove = [];
while (walker.nextNode()) {
const textNode = walker.currentNode;
if (!textNode.nodeValue.trim()) {
if (!/[\xA0\S]/.test(textNode.nodeValue)) { // allow \xA0 to keep  
toRemove.push(textNode);
}
}