summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2024-03-17 11:29:25 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2024-03-17 11:29:25 -0700
commita6392207fc560fff2d136132ecd6219b7e5f6bfd (patch)
tree68d805dc18cee645a300cf6497640776f0e79726 /test
parent9ae7557ac0ac27ee63e8b32aec2bab53b008f72a (diff)
Typst writer: avoid unnecessary box around image in figure.
See #9236.
Diffstat (limited to 'test')
-rw-r--r--test/command/9236.md36
-rw-r--r--test/writer.typst2
2 files changed, 37 insertions, 1 deletions
diff --git a/test/command/9236.md b/test/command/9236.md
new file mode 100644
index 000000000..4536f0b09
--- /dev/null
+++ b/test/command/9236.md
@@ -0,0 +1,36 @@
+```
+% pandoc -t typst
+![minimal](command/minimal.svg){width=3in}
+
+![minimal](command/minimal.svg){width=3in height=2in}
+
+![minimal](command/minimal.svg)
+
+And inline: ![minimal](command/minimal.svg){height=2in} and
+![minimal](command/minimal.svg).
+^D
+#figure(image("command/minimal.svg", width: 3in),
+ caption: [
+ minimal
+ ],
+ kind: auto
+)
+
+#figure(image("command/minimal.svg", height: 2in, width: 3in),
+ caption: [
+ minimal
+ ],
+ kind: auto
+)
+
+#figure(image("command/minimal.svg"),
+ caption: [
+ minimal
+ ],
+ kind: auto
+)
+
+And inline: #box(image("command/minimal.svg", height: 2in)) and
+#box(image("command/minimal.svg")).
+
+```
diff --git a/test/writer.typst b/test/writer.typst
index 6fcf3abe5..02151f4e6 100644
--- a/test/writer.typst
+++ b/test/writer.typst
@@ -784,7 +784,7 @@ or here: <http://example.com/>
<images>
From "Voyage dans la Lune" by Georges Melies (1902):
-#figure([#box(image("lalune.jpg"))],
+#figure(image("lalune.jpg"),
caption: [
lalune
],