Skip to content

Rewrite the poster attribute when rewriting HTML - #347

Merged
benoit74 merged 1 commit into
openzim:mainfrom
anshuman83-40:rewrite-poster-attribute
Oct 13, 2026
Merged

benoit74 merged 1 commit into
openzim:mainfrom
anshuman83-40:rewrite-poster-attribute

Conversation

@anshuman83-40

Copy link
Copy Markdown
Contributor

Fix #339

The poster attribute (e.g. of <video>) holds a URL like src and href, but it was not rewritten, so the poster image pointed outside of the ZIM. It is now handled by the same rule as href and src.

Added test_rewrite_poster_attribute: absolute URL, alongside src, relative URL with a query, a data: URL that must be kept, and an attribute without a value.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (164a0c3) to head (46ad1d1).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #347   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           42        42           
  Lines         2694      2694           
  Branches       398       398           
=========================================
  Hits          2694      2694           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The poster attribute (e.g. of <video>) holds a URL like src and href, but
it was left as is, so the poster image pointed outside of the ZIM.

Fix openzim#339
@benoit74
benoit74 force-pushed the rewrite-poster-attribute branch from 46ad1d1 to 3889dac Compare October 13, 2026 09:54

@benoit74 benoit74 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you very much

@benoit74
benoit74 merged commit 9b47195 into openzim:main Oct 13, 2026
1 check 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.

HTML rewriting: also rewrite poster attribute

2 participants