Commit 94e348b
authored
fix(pptx/render): emit valid SVG <image> for image-fill backgrounds (#100)
* fix(pptx/render): emit valid SVG <image> for image-fill backgrounds
renderDeckToSvg rendered a slide's image-fill background as a CSS
background shorthand inside fill="…" (center / cover no-repeat
url("data:image…")) — invalid SVG that strict rasterisers (resvg,
librsvg) reject, blocking a Chromium-free render path. The renderer now
recognises a url(...) anywhere in the value and emits a real <image>
element (slice for cover, meet for contain). Adds a strict-XML-parser
lock-in test over an image-background fixture.
* test(render): rasterise image-background slide through real @resvg/resvg-js
XMLValidator proves well-formedness only; resvg is the actual consumer.
Add @resvg/resvg-js as a devDependency and drive an image-background
slide through the package's default rasteriser (no injected hook),
asserting a valid PNG of the expected dimensions (320x180). resvg threw
on the old fill="...url(data:...)..." output, so this is a true guard.
* Revert "test(render): rasterise image-background slide through real @resvg/resvg-js"
This reverts commit 3f9d393. Keep the resvg renderability check on the
consumer side (the host serializer already ships @resvg/resvg-js) rather
than dragging a platform-native binary into the package's CI. The bug was
an SVG-validity (well-formedness) regression, which the pure-JS
XMLValidator lock-in already catches — it was confirmed to reject the old
malformed output. The package CI stays native-dep-free.1 parent 6c38b79 commit 94e348b
3 files changed
Lines changed: 89 additions & 4 deletions
File tree
- .changeset
- packages/slidewise/src/lib/render
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
149 | 201 | | |
150 | 202 | | |
151 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
| |||
499 | 500 | | |
500 | 501 | | |
501 | 502 | | |
502 | | - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
503 | 509 | | |
504 | 510 | | |
505 | 511 | | |
506 | | - | |
507 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
508 | 521 | | |
509 | 522 | | |
510 | 523 | | |
| |||
0 commit comments