You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I suggest few small changes to make the generated template functions more stable:
Add newlines (\n) before "out+=", this allows the templates to contain single line comments (//), otherwise these comments are carried in the generated function code thus breaking it.
Add check for null and undefined values in jqoteenc. Without this check jqotenc crashes on null and undefined values because they don't have .toString() method. I guess booleans will crash too, but I haven't tested this.
Hi. Thanks for the good work.
I suggest few small changes to make the generated template functions more stable:
Add newlines (\n) before "out+=", this allows the templates to contain single line comments (//), otherwise these comments are carried in the generated function code thus breaking it.
line 134:
for ( var m=0,l=arr.length; m < l; m++ )
str += arr[m].charAt(0) !== '\x1b' ?
"\nout+='" + arr[m].replace(/(|["'])/g, '$1') + "'" : (arr[m].charAt(1) === '=' ?
';\nout+=(' + arr[m].substr(2) + ');' : (arr[m].charAt(1) === '!' ?
';\nout+=$.jqotenc((' + arr[m].substr(2) + '));' : ';' + arr[m].substr(1)));
Add check for null and undefined values in jqoteenc. Without this check jqotenc crashes on null and undefined values because they don't have .toString() method. I guess booleans will crash too, but I haven't tested this.
line 168:
jqotenc: function(str) {
if(str === null || str === undefined) return '';
return str.toString()
.replace(/&(?!\w+;)/g, '&')
.split('<').join('<').split('>').join('>')
.split('"').join('"').split("'").join(''');
The text was updated successfully, but these errors were encountered: