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

Line 31: Line 31:
 
     var paragraphs = document.getElementsByTagName("p");  
 
     var paragraphs = document.getElementsByTagName("p");  
 
     var len = paragraphs.length;
 
     var len = paragraphs.length;
     for (var i = 0; i < len; i++) {
+
     for (var i = 0; i < len; i++)  
 +
    {
 
         var elem = paragraphs[i];
 
         var elem = paragraphs[i];
 
         if (elem.innerHTML.trim() == '<br>')
 
         if (elem.innerHTML.trim() == '<br>')
Line 47: Line 48:
 
             continue;
 
             continue;
 
         }
 
         }
 +
    }
 +
    var brs = document.getElementsByTagName("br");
 +
    var len = brs.length;
 +
    for (var i = 0; i < len; i++)
 +
    {
 +
        var elem = brs[i];
 +
        elem.parentNode.removeChild(elem);
 +
        i--;
 +
        len--;
 +
        continue;
 
     }
 
     }
 
     paragraphs[paragraphs.length - 1].parentNode.removeChild(paragraphs[paragraphs.length - 1]);
 
     paragraphs[paragraphs.length - 1].parentNode.removeChild(paragraphs[paragraphs.length - 1]);

Revision as of 16:22, 15 September 2015