aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-08-29 23:48:08 +0200
committerJohn MacFarlane <[email protected]>2025-08-30 00:04:23 +0200
commitf865b3bc4bc6fb29fdfb1b44778952b5efb578ab (patch)
treed7d9e12cd6594661cbb63b261faf8bb213cd4103 /test
parent729c12394cb69ecc2d8c8d6177d2cc5526e51a13 (diff)
Typst reader: properly resolve image paths in included files.
Closes #11090.
Diffstat (limited to 'test')
-rw-r--r--test/command/11090.md49
-rw-r--r--test/command/11090/ch1.typ6
2 files changed, 55 insertions, 0 deletions
diff --git a/test/command/11090.md b/test/command/11090.md
new file mode 100644
index 000000000..d32c52b7d
--- /dev/null
+++ b/test/command/11090.md
@@ -0,0 +1,49 @@
+```
+% pandoc -f typst -t native
+#include "command/11090/ch1.typ"
+
+== Chapter Two
+
+#figure(
+ image("command/11090/media/image1.png"),
+ caption: [This is an image.]
+)
+^D
+[ Header
+ 2 ( "" , [] , [] ) [ Str "Chapter" , Space , Str "One" ]
+, Figure
+ ( "" , [] , [] )
+ (Caption
+ Nothing [ Para [ Str "An" , Space , Str "image." ] ])
+ [ Para
+ [ Image
+ ( "" , [] , [] )
+ []
+ ( "command/11090/media/image1.png" , "" )
+ ]
+ ]
+, Header
+ 2 ( "" , [] , [] ) [ Str "Chapter" , Space , Str "Two" ]
+, Figure
+ ( "" , [] , [] )
+ (Caption
+ Nothing
+ [ Para
+ [ Str "This"
+ , Space
+ , Str "is"
+ , Space
+ , Str "an"
+ , Space
+ , Str "image."
+ ]
+ ])
+ [ Para
+ [ Image
+ ( "" , [] , [] )
+ []
+ ( "command/11090/media/image1.png" , "" )
+ ]
+ ]
+]
+```
diff --git a/test/command/11090/ch1.typ b/test/command/11090/ch1.typ
new file mode 100644
index 000000000..ae88ecfc9
--- /dev/null
+++ b/test/command/11090/ch1.typ
@@ -0,0 +1,6 @@
+== Chapter One
+
+#figure(
+ image("media/image1.png"),
+ caption: [An image.]
+)