Skip to content

Commit

Permalink
Removing extra space
Browse files Browse the repository at this point in the history
  • Loading branch information
sburel committed Jan 24, 2015
1 parent 9d6d770 commit b6a2c2e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions lib/square.js
Expand Up @@ -37,11 +37,14 @@ var Square;
};
Text.prototype.print = function (stream, carriageReturn) {
var text = this.buffer;
text = text.replace('\n', ' ');
text = text.replace(/\\n/g, '');
text = text.replace(/\\t/g, '');
text = text.replace(/\s+/g, ' ');
stream.write('result += \"');
stream.write(text);
stream.write('\";');
if (text) {
stream.write('result += \"');
stream.write(text);
stream.write('\";');
}
};
return Text;
})();
Expand Down
11 changes: 7 additions & 4 deletions sources/square.ts
Expand Up @@ -53,11 +53,14 @@ module Square {

print(stream, carriageReturn) {
var text = this.buffer;
text = text.replace('\n', ' ');
text = text.replace(/\\n/g, '');
text = text.replace(/\\t/g, '');
text = text.replace(/\s+/g, ' ');
stream.write('result += \"')
stream.write(text);
stream.write('\";');
if (text) {
stream.write('result += \"')
stream.write(text);
stream.write('\";');
}
}
}

Expand Down

0 comments on commit b6a2c2e

Please sign in to comment.