GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow arbitrary whitespaces in since, extends, config and not queries by abhu85 · Pull Request #954 · browserslist/browserslist

Conversation

@abhu85

@abhu85 abhu85 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Most queries accept any amount of whitespace between their words (last 2 versions, > 1% in US, and supports queries since 4.22.3), but a few matched exactly one space:

browserslist('since  2020')            // Unknown browser since
browserslist('browserslist  config')   // Unknown browser query
browserslist('ie 6, not  ie 6')        // Unknown browser query `not  ie 6`
browserslist('extends  browserslist-config-x')
// tries to load ' browserslist-config-x' (with the leading space)

This PR uses \s+ in the since (3 forms), browserslist config and extends regexps and in the not prefix in parse.js, and updates grammar.w3c-ebnf to match.

For extends and not, the (?!\s) guard from baseline (c935c5a) is used. Without it, extends\s+(.+) backtracks quadratically on a long run of spaces: an 80k-space padded query took about 1.9 s, and takes 3 ms with the guard, the same as before this change.

Tests: added cases to since, extends, config-query and parse tests; each fails without the change. c8 uvu: 324 passed with 100% line coverage, and eslint and size-limit pass.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@abhu85
Allow arbitrary whitespaces in since, extends, config and not queries
893120b
The `since`, `extends`, `browserslist config` queries and the `not`
prefix matched exactly one space between their words, while other
queries accept any amount of whitespace, the same way `supports` queries
were fixed in 4.22.3. `since  2020`, `browserslist  config` and
`not  ie 11` threw "Unknown browser query" and
`extends  browserslist-config-x` tried to load ` browserslist-config-x`.

The `(?!\s)` guard keeps the `extends` and `not` regexps linear on
queries padded with long whitespace runs.
@ai
ai merged commit 8219dd7 into browserslist:main Sep 30, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ai

ai commented Sep 30, 2026

Copy link
Copy Markdown
Member

Thanks

abhu85 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@abhu85
abhu85 deleted the fix-since-extends-whitespace branch September 30, 2026 17:10
This was referenced Oct 24, 2026
refactor: Bump browserslist from 4.28.1 to 4.29.4 parse-community/docs#990
Merged
refactor: Bump browserslist from 4.16.6 to 4.29.4 parse-community/node-apn#228
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@abhu85 @ai
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.