Skip to content

reject whitespace inside An+B numbers in parse_series - #217

Merged
AdrianAtZyte merged 1 commit into
scrapy:masterfrom
itecz26:series-whitespace
Oct 26, 2026
Merged

AdrianAtZyte merged 1 commit into
scrapy:masterfrom
itecz26:series-whitespace

Conversation

@itecz26

@itecz26 itecz26 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

parse_series() glues the :nth-*() argument tokens back together after parse_arguments() has dropped the whitespace between them, so :nth-child(1 2) is translated as :nth-child(12), 2n + 1 0 as 2n+10 and 2 n as 2n (browsers reject all of these, An+B only allows whitespace around the sign of B), so this keeps a space wherever two tokens weren't adjacent in the source and only accepts it around that sign, leaving 2n + 1, 2n- 1 and 2n /* c */ + 1 as they were.

@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.80%. Comparing base (6be624a) to head (0b992d2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #217   +/-   ##
=======================================
  Coverage   99.80%   99.80%           
=======================================
  Files           3        3           
  Lines        1002     1014   +12     
  Branches      166      169    +3     
=======================================
+ Hits         1000     1012   +12     
  Misses          1        1           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AdrianAtZyte
AdrianAtZyte merged commit 0a0c197 into scrapy:master Oct 26, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants