Skip to content

Commit db13207

Browse files
author
Lauren McCarthy
committed
Merge pull request #463 from therewasaguy/escape
escape --> escapeHelper
2 parents 6212a74 + 0deb07b commit db13207

File tree

3 files changed

+23
-24
lines changed

3 files changed

+23
-24
lines changed

lib/p5.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! p5.js v0.3.14 December 17, 2014 */
1+
/*! p5.js v0.3.14 December 21, 2014 */
22
var shim = function (require) {
33
window.requestDraw = function () {
44
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback, element) {
@@ -3766,9 +3766,6 @@ var outputfiles = function (require, core) {
37663766
p5.prototype.endRecord = function () {
37673767
throw 'not yet implemented';
37683768
};
3769-
p5.prototype.escape = function (content) {
3770-
return content.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;');
3771-
};
37723769
p5.PrintWriter = function (filename, extension) {
37733770
var self = this;
37743771
this.name = filename;
@@ -3907,7 +3904,7 @@ var outputfiles = function (require, core) {
39073904
if (header[0] !== '0') {
39083905
pWriter.println(' <tr>');
39093906
for (var k = 0; k < header.length; k++) {
3910-
var e = p5.prototype.escape(header[k]);
3907+
var e = escapeHelper(header[k]);
39113908
pWriter.println(' <td>' + e);
39123909
pWriter.println(' </td>');
39133910
}
@@ -3917,7 +3914,7 @@ var outputfiles = function (require, core) {
39173914
pWriter.println(' <tr>');
39183915
for (var col = 0; col < table.columns.length; col++) {
39193916
var entry = table.rows[row].getString(col);
3920-
var htmlEntry = p5.prototype.escape(entry);
3917+
var htmlEntry = escapeHelper(entry);
39213918
pWriter.println(' <td>' + htmlEntry);
39223919
pWriter.println(' </td>');
39233920
}
@@ -3930,6 +3927,9 @@ var outputfiles = function (require, core) {
39303927
pWriter.close();
39313928
pWriter.flush();
39323929
};
3930+
var escapeHelper = function (content) {
3931+
return content.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;');
3932+
};
39333933
p5.prototype.writeFile = function (dataToDownload, filename, extension) {
39343934
var type = 'application/octet-stream';
39353935
if (p5.prototype._isSafari()) {

0 commit comments

Comments
 (0)