summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-02-17 11:56:00 +0100
committerLaurenz <laurmaedje@gmail.com>2025-02-17 12:49:15 +0100
commitd48708c5d55a5d56e4cd3a3b0de38425a6fd8380 (patch)
tree6719334fc6d5f5ab334f1a3cc46021f852df6cbe /tests
parente294fe85a591f01aef1c2466aa0618dda3c58095 (diff)
More robust SVG auto-detection (#5878)
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/image-svg-auto-detection.pngbin0 -> 129 bytes
-rw-r--r--tests/suite/visualize/image.typ15
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
new file mode 100644
index 00000000..0240f8f5
--- /dev/null
+++ b/tests/ref/image-svg-auto-detection.png
Binary files differ
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)