Skip to content

fix(html): rewrite CSS url() references to use hashed filenames#3046

Open
jhult wants to merge 2 commits intorust-lang:masterfrom
jhult:fix/css-url-rewriting
Open

fix(html): rewrite CSS url() references to use hashed filenames#3046
jhult wants to merge 2 commits intorust-lang:masterfrom
jhult:fix/css-url-rewriting

Conversation

@jhult
Copy link
Copy Markdown
Contributor

@jhult jhult commented Mar 3, 2026

Fixes #2958

When font files are hashed for cache-busting, CSS url() references were not updated to use the hashed filenames, causing custom fonts to fail loading.

This fix rewrites url() references in CSS files during write_files, handling all three quoting styles (url("…"), url('…'), url(…)), resolving paths relative to the CSS file's location before looking up in the hash map, and leaving absolute/data URLs untouched.

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Mar 3, 2026
@jhult jhult force-pushed the fix/css-url-rewriting branch from f71812a to cacc8f7 Compare March 16, 2026 19:25
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 16, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local custom font files are serialized since version 0.5 - how to reference them?

2 participants