Skip to content

Commit

Permalink
Fix comma escaping only escapes first comma
Browse files Browse the repository at this point in the history
  • Loading branch information
nate-allen committed Jul 2, 2023
1 parent 345450f commit 0e51f0b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions views/admin/js/bulk-term-generator-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,7 @@
// Seperate terms by comma, and trim the white space
for (var i = 0; i < terms.length; i++) {
console.log(terms[i].match(/([^,]+),([^,]+),(.*)/));
var terms_array = terms[i].replace('\\,', '{COMMA}').split(',').map(function (v) {
return v.replace('{COMMA}', ',');
});
var terms_array = terms[i].replace( /\\,/g, '{COMMA}' ).split(',').map(function(v){return v.replace( /{COMMA}/g,',');});
terms_array = $.map(terms_array, $.trim);
processedTerms.push(terms_array);
}
Expand Down

0 comments on commit 0e51f0b

Please sign in to comment.