diff options
| author | Laurenz <laurmaedje@gmail.com> | 2025-02-17 11:56:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-17 10:56:00 +0000 |
| commit | 25c86accbb4adc0e7542d2c5957dff6e939cbf48 (patch) | |
| tree | 8db19e48038ffe1eeee1232dc54ec242ce48e029 /tests | |
| parent | 5fc679f3e7501ee5831f1b4b7789350f43b4c221 (diff) | |
More robust SVG auto-detection (#5878)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ref/image-svg-auto-detection.png | bin | 0 -> 129 bytes | |||
| -rw-r--r-- | tests/suite/visualize/image.typ | 15 |
2 files changed, 13 insertions, 2 deletions
diff --git a/tests/ref/image-svg-auto-detection.png b/tests/ref/image-svg-auto-detection.png Binary files differnew file mode 100644 index 00000000..0240f8f5 --- /dev/null +++ b/tests/ref/image-svg-auto-detection.png diff --git a/tests/suite/visualize/image.typ b/tests/suite/visualize/image.typ index e37932f2..7ce0c8c0 100644 --- a/tests/suite/visualize/image.typ +++ b/tests/suite/visualize/image.typ @@ -65,6 +65,17 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B caption: [Bilingual text] ) +--- image-svg-auto-detection --- +#image(bytes( + ``` + <?xml version="1.0" encoding="utf-8"?> + <!-- An SVG --> + <svg width="200" height="150" xmlns="http://www.w3.org/2000/svg"> + <rect fill="red" stroke="black" x="25" y="25" width="150" height="100"/> + </svg> + ```.text +)) + --- image-pixmap-rgb8 --- #image( bytes(( @@ -152,8 +163,8 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B #image("path/does/not/exist") --- image-bad-format --- -// Error: 2-22 unknown image format -#image("./image.typ") +// Error: 2-37 unknown image format +#image("/assets/plugins/hello.wasm") --- image-bad-svg --- // Error: 2-33 failed to parse SVG (found closing tag 'g' instead of 'style' in line 4) |
