Skip to content

Preserve SVG fragments in CSS image URLs - #167

Open
nexiumbiz-debug wants to merge 1 commit into
qq15725:mainfrom
nexiumbiz-debug:codex/preserve-svg-background-fragments-142
Open

Preserve SVG fragments in CSS image URLs#167
nexiumbiz-debug wants to merge 1 commit into
qq15725:mainfrom
nexiumbiz-debug:codex/preserve-svg-background-fragments-142

Conversation

@nexiumbiz-debug

@nexiumbiz-debug nexiumbiz-debug commented May 17, 2026

Copy link
Copy Markdown

Summary

  • preserve SVG fragment identifiers such as #svgView(...) when CSS image URLs are embedded as data URLs
  • fetch/cache the actual SVG resource without the fragment, then append the fragment back onto the generated data URL
  • add a regression test for CSS url("...svg#svgView(...)") replacement

Fixes #142.

Testing

  • corepack pnpm exec vitest run test/nodejs.test.ts --pool=forks --maxWorkers=1 --minWorkers=1 --no-file-parallelism
  • corepack pnpm exec eslint src/css-url.ts test/nodejs.test.ts
  • corepack pnpm exec tsc --noEmit
  • git diff --check

Note: the default Vitest worker-pool run crashed under local Node 24 before collecting tests, so I reran the focused test file with one worker and it 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.

SVG fragment identifiers being ignored on background images

1 participant