Skip to content

Commit

Permalink
Merge pull request #257 from jekor/master
Browse files Browse the repository at this point in the history
collapse whitespace according to spec
  • Loading branch information
maltsev committed Sep 22, 2023
2 parents f47d4e7 + c6eb5e9 commit f446f89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/modules/collapseWhitespace.es6
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const noTrimWhitespacesInsideElements = new Set([

const startsWithWhitespacePattern = /^\s/;
const endsWithWhitespacePattern = /\s$/;
const multipleWhitespacePattern = /\s+/g;
// See https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace and https://infra.spec.whatwg.org/#ascii-whitespace
const multipleWhitespacePattern = /[\t\n\f\r ]{2,}/g;
const NONE = '';
const SINGLE_SPACE = ' ';
const validOptions = ['all', 'aggressive', 'conservative'];
Expand Down

0 comments on commit f446f89

Please sign in to comment.