Skip to content

Commit

Permalink
lint new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-deyoungster committed Nov 8, 2022
1 parent c2c1b11 commit 36fc276
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 56 deletions.
32 changes: 17 additions & 15 deletions dist/purify.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.cjs.js.map

Large diffs are not rendered by default.

32 changes: 17 additions & 15 deletions dist/purify.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.es.js.map

Large diffs are not rendered by default.

32 changes: 17 additions & 15 deletions dist/purify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/purify.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/purify.min.js.map

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions src/purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ function createDOMPurify(window = getGlobal()) {

/* Allowed XHTML+XML namespaces */
let ALLOWED_NAMESPACES = null;
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [
MATHML_NAMESPACE,
SVG_NAMESPACE,
HTML_NAMESPACE,
], stringToString);
const DEFAULT_ALLOWED_NAMESPACES = addToSet(
{},
[MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE],
stringToString
);

/* Parsing of strict XHTML documents */
let PARSER_MEDIA_TYPE;
Expand Down Expand Up @@ -816,7 +816,10 @@ function createDOMPurify(window = getGlobal()) {
leadingWhitespace = matches && matches[0];
}

if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
if (
PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&
NAMESPACE === HTML_NAMESPACE
) {
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
dirty =
'<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' +
Expand Down

0 comments on commit 36fc276

Please sign in to comment.