DEV: apply new coding standards (#10592)

This commit is contained in:
Joffrey JAFFEUX
2020-09-04 13:42:47 +02:00
committed by GitHub
parent 80dfaeb0d2
commit 52672b9eab
1473 changed files with 9386 additions and 9958 deletions

View File

@@ -14,7 +14,7 @@ const ESCAPE_REPLACEMENTS = {
">": ">",
'"': """,
"'": "'",
"`": "`"
"`": "`",
};
const BAD_CHARS = /[&<>"'`]/g;
const POSSIBLE_CHARS = /[&<>"'`]/;
@@ -84,7 +84,7 @@ export function sanitize(text, whiteLister) {
if (allowedHrefSchemes && allowedHrefSchemes.length > 0) {
extraHrefMatchers = [
new RegExp("^(" + allowedHrefSchemes.join("|") + ")://[\\w\\.\\-]+", "i")
new RegExp("^(" + allowedHrefSchemes.join("|") + ")://[\\w\\.\\-]+", "i"),
];
if (allowedHrefSchemes.includes("tel")) {
extraHrefMatchers.push(new RegExp("^tel://\\+?[\\w\\.\\-]+", "i"));
@@ -113,7 +113,7 @@ export function sanitize(text, whiteLister) {
hrefAllowed(value, extraHrefMatchers))) ||
(tag === "iframe" &&
name === "src" &&
allowedIframes.some(i => {
allowedIframes.some((i) => {
return value.toLowerCase().indexOf((i || "").toLowerCase()) === 0;
}))
) {
@@ -140,7 +140,7 @@ export function sanitize(text, whiteLister) {
}
}
}
}
},
});
return result