function scope: variables only need to be declared once

This commit is contained in:
webzwo0i 2013-12-08 13:47:05 +01:00
parent 0fa0d6dc2c
commit c3081c046b

View file

@ -234,14 +234,14 @@ function getHTMLFromAtext(pad, atext, authorColors)
// close all tags upto the outer most // close all tags upto the outer most
if (outermostTag != -1) if (outermostTag != -1)
{ {
for (var i=0; i <= outermostTag; outermostTag--) for (i=0; i <= outermostTag; outermostTag--)
{ {
emitCloseTag(openTags[0]) emitCloseTag(openTags[0])
} }
} }
// open all tags that are used but not open // open all tags that are used but not open
for (var i=0; i < usedAttribs.length; i++) for (i=0; i < usedAttribs.length; i++)
{ {
if (openTags.indexOf(usedAttribs[i]) === -1) if (openTags.indexOf(usedAttribs[i]) === -1)
{ {
@ -511,8 +511,8 @@ function _processSpaces(s){
} }
} }
// beginning of line is nbsp // beginning of line is nbsp
for (var i = 0; i < parts.length; i++){ for (i = 0; i < parts.length; i++){
var p = parts[i]; p = parts[i];
if (p == " "){ if (p == " "){
parts[i] = '&nbsp;'; parts[i] = '&nbsp;';
break; break;
@ -524,8 +524,8 @@ function _processSpaces(s){
} }
else else
{ {
for (var i = 0; i < parts.length; i++){ for (i = 0; i < parts.length; i++){
var p = parts[i]; p = parts[i];
if (p == " "){ if (p == " "){
parts[i] = '&nbsp;'; parts[i] = '&nbsp;';
} }