diff --git a/.changeset/render-image-bg-valid-svg.md b/.changeset/render-image-bg-valid-svg.md deleted file mode 100644 index 0a9f051..0000000 --- a/.changeset/render-image-bg-valid-svg.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -"@textcortex/slidewise": patch ---- - -fix(render): emit a valid SVG `` for image-fill backgrounds - -`renderDeckToSvg` rendered a slide's image-fill background as a CSS `background` -shorthand inside an SVG `fill="…"` attribute — `fill="center / cover no-repeat -url("data:image…")"`. That is not valid SVG (a non-paint value plus nested -unescaped quotes); browsers tolerate it, but strict rasterisers -(`@resvg/resvg-js`, librsvg, batik) reject it, blocking a Chromium-free -`parsePptx → renderDeckToSvg → resvg → PNG` path. - -The pptx importer stores image backgrounds as a CSS shorthand, but the -renderer's image-ref detection only inspected the *start* of the value, so the -shorthand fell through to the `fill` path. The renderer now recognises a -`url(...)` anywhere in the value and emits a real `` element -(`preserveAspectRatio` = `slice` for `cover`, `meet` for `contain`). A lock-in -test asserts every rendered slide is valid SVG a strict XML parser accepts, -with an image-background slide as the regression case. diff --git a/packages/slidewise/CHANGELOG.md b/packages/slidewise/CHANGELOG.md index e04a81c..90dd92f 100644 --- a/packages/slidewise/CHANGELOG.md +++ b/packages/slidewise/CHANGELOG.md @@ -1,5 +1,26 @@ # @textcortex/slidewise +## 1.21.1 + +### Patch Changes + +- 94e348b: fix(render): emit a valid SVG `` for image-fill backgrounds + + `renderDeckToSvg` rendered a slide's image-fill background as a CSS `background` + shorthand inside an SVG `fill="…"` attribute — `fill="center / cover no-repeat +url("data:image…")"`. That is not valid SVG (a non-paint value plus nested + unescaped quotes); browsers tolerate it, but strict rasterisers + (`@resvg/resvg-js`, librsvg, batik) reject it, blocking a Chromium-free + `parsePptx → renderDeckToSvg → resvg → PNG` path. + + The pptx importer stores image backgrounds as a CSS shorthand, but the + renderer's image-ref detection only inspected the _start_ of the value, so the + shorthand fell through to the `fill` path. The renderer now recognises a + `url(...)` anywhere in the value and emits a real `` element + (`preserveAspectRatio` = `slice` for `cover`, `meet` for `contain`). A lock-in + test asserts every rendered slide is valid SVG a strict XML parser accepts, + with an image-background slide as the regression case. + ## 1.21.0 ### Minor Changes diff --git a/packages/slidewise/package.json b/packages/slidewise/package.json index afa1693..d5447a4 100644 --- a/packages/slidewise/package.json +++ b/packages/slidewise/package.json @@ -1,6 +1,6 @@ { "name": "@textcortex/slidewise", - "version": "1.21.0", + "version": "1.21.1", "description": "Embeddable React PPTX editor.", "license": "MIT", "type": "module", diff --git a/website/CHANGELOG.md b/website/CHANGELOG.md index 64e7caa..1f2c84b 100644 --- a/website/CHANGELOG.md +++ b/website/CHANGELOG.md @@ -1,5 +1,12 @@ # website +## 0.0.36 + +### Patch Changes + +- Updated dependencies [94e348b] + - @textcortex/slidewise@1.21.1 + ## 0.0.35 ### Patch Changes diff --git a/website/package.json b/website/package.json index 8becfd7..9767f45 100644 --- a/website/package.json +++ b/website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "0.0.35", + "version": "0.0.36", "private": true, "type": "module", "scripts": {