Skip to content

match browser-tolerant end tags in remove_tags_with_content - #302

Open
uchiha-bug-hunter wants to merge 1 commit into
scrapy:masterfrom
uchiha-bug-hunter:remove-tags-tolerant-end-tag
Open

match browser-tolerant end tags in remove_tags_with_content#302
uchiha-bug-hunter wants to merge 1 commit into
scrapy:masterfrom
uchiha-bug-hunter:remove-tags-tolerant-end-tag

Conversation

@uchiha-bug-hunter

Copy link
Copy Markdown
Contributor

remove_tags_with_content only closed on a bare </tag>
Browsers end an element on the tag name followed by whitespace, /, or >, so </script >, </script\n>, </script/> and </script foo> all close it, yet these left the tag and its content in place. get_meta_refresh relies on this to strip <script>/<noscript>, so a <meta http-equiv=refresh> hidden as text inside a space-closed <script> came back as a redirect target that no browser follows.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.47%. Comparing base (22d04b7) to head (fc0f8bd).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #302   +/-   ##
=======================================
  Coverage   98.47%   98.47%           
=======================================
  Files           9        9           
  Lines         853      853           
  Branches      177      177           
=======================================
  Hits          840      840           
  Misses          5        5           
  Partials        8        8           
Files with missing lines Coverage Δ
w3lib/html.py 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq

codspeed-hq Bot commented Aug 10, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 45 untouched benchmarks


Comparing uchiha-bug-hunter:remove-tags-tolerant-end-tag (fc0f8bd) with master (22d04b7)

Open in CodSpeed

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.

2 participants