Skip to content

Commit

Permalink
collapse whitespace according to spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jekor committed Sep 21, 2023
1 parent f47d4e7 commit c6eb5e9
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 c6eb5e9

Please sign in to comment.