Skip to content

Commit

Permalink
Make coding style project consistent.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAnthony committed Jul 24, 2020
1 parent cdd3e36 commit 433dbd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 5 additions & 3 deletions lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ function parseTag(html, onTag, escapeHtml) {
}
if ((c === '"' || c === "'")) {
var i = 1;
while ((html.charAt(currentPos - i) === " ") || (html.charAt(currentPos - i) === "=")) {
if (html.charAt(currentPos - i) === "=") {
var ic = html.charAt(currentPos - i);

while ((ic === " ") || (ic === "=")) {
if (ic === "=") {
quoteStart = c;
continue chariterator;
}
i++;
ic = html.charAt(currentPos - ++i);
}
}
} else {
Expand Down
5 changes: 2 additions & 3 deletions test/test_custom_method.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,8 @@ describe("test custom XSS method", function() {
var html = xss(source, {
onTag: function(_, E, S) {
if (S.isWhite && "a" === _) {
if (S.isClosing)
return "</span></a>";
return "".concat(E, '<span>')
if (S.isClosing) return "</span></a>";
return "".concat(E, '<span>');
}
}
});
Expand Down

0 comments on commit 433dbd7

Please sign in to comment.