Skip to content

Commit

Permalink
Merge pull request #57 from insolite/44-fix-removing-inner-whitespaces
Browse files Browse the repository at this point in the history
Fix unneeded removing of inner whitespaces
  • Loading branch information
ahmadudin authored May 22, 2018
2 parents 05a0fc5 + 0c1c1f2 commit 8ee0452
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ var app = {
var parsed =
"'" +
input
.replace(/\s+/g, "")
.split(",")
.join("', '") +
.trim()
.replace(/\s*,\s*/g, "', '") +
"'";

return parsed;
Expand Down Expand Up @@ -258,12 +257,11 @@ var app = {
})

// Add `u`(Python unicode indentifier) beginning of each comment.
escapedComments =
escapedComments =
'u' +
escapedComments
.replace(/\s+/g, "")
.split("',")
.join("', u");
.trim()
.replace(/'\s*,\s*'/, "', u'");

content = `\nsession.set_do_comment(enabled=True, percentage=${data.commentsPercent})\nsession.set_comments([${escapedComments}], media=${value})`;
}
Expand Down

0 comments on commit 8ee0452

Please sign in to comment.