Difference between revisions of "Team:Czech Republic/Template:Scripts"

Line 39: Line 39:
 
for (var i = 0, len = paragraphs.length; i < len; i++) {
 
for (var i = 0, len = paragraphs.length; i < len; i++) {
 
     var elem = paragraphs[i];
 
     var elem = paragraphs[i];
     if (elem.childElementCount == 0 && elem.textContent.trim() == '') {
+
     if (elem.childElementCount == 0) {
        elem.parentNode.removeChild(elem);
+
        if (elem.textContent.trim() == '') {
        i--;
+
            elem.parentNode.removeChild(elem);
        len--;
+
            i--;
 +
            len--;
 +
        }
 
     }
 
     }
  }
+
}
 
}
 
}
 
</script>
 
</script>

Revision as of 16:46, 9 September 2015