Skip to content

Commit

Permalink
See #433
Browse files Browse the repository at this point in the history
fix: Added better regex for whitespace detection
  • Loading branch information
cure53 committed May 5, 2020
1 parent ac5c29c commit 67e7faa
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 13 deletions.
3 changes: 1 addition & 2 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.

3 changes: 1 addition & 2 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.

3 changes: 1 addition & 2 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.

3 changes: 1 addition & 2 deletions src/purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,7 @@ function createDOMPurify(window = getGlobal()) {
dirty = '<remove></remove>' + dirty;
} else {
/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
// eslint-disable-next-line unicorn/better-regex
const matches = stringMatch(dirty, /^[\s]+/);
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
leadingWhitespace = matches && matches[0];
}

Expand Down

0 comments on commit 67e7faa

Please sign in to comment.