Make coding style project consistent.

This commit is contained in:
Tom Anthony
2020-07-24 10:41:06 +01:00
parent f454fd76e6
commit 379d181273
2 changed files with 7 additions and 6 deletions

View File

@@ -87,12 +87,14 @@ function parseTag(html, onTag, escapeHtml) {
} }
if ((c === '"' || c === "'")) { if ((c === '"' || c === "'")) {
var i = 1; var i = 1;
while ((html.charAt(currentPos - i) === " ") || (html.charAt(currentPos - i) === "=")) { var ic = html.charAt(currentPos - i);
if (html.charAt(currentPos - i) === "=") {
while ((ic === " ") || (ic === "=")) {
if (ic === "=") {
quoteStart = c; quoteStart = c;
continue chariterator; continue chariterator;
} }
i++; ic = html.charAt(currentPos - ++i);
} }
} }
} else { } else {

View File

@@ -366,9 +366,8 @@ describe("test custom XSS method", function() {
var html = xss(source, { var html = xss(source, {
onTag: function(_, E, S) { onTag: function(_, E, S) {
if (S.isWhite && "a" === _) { if (S.isWhite && "a" === _) {
if (S.isClosing) if (S.isClosing) return "</span></a>";
return "</span></a>"; return "".concat(E, '<span>');
return "".concat(E, '<span>')
} }
} }
}); });