mirror of
https://github.com/typst/typst
synced 2025-06-19 03:42:53 +08:00
Consume data
argument in pdf.embed()
(#6435)
This commit is contained in:
parent
f9897479d2
commit
4a638f41cd
@ -59,7 +59,7 @@ pub struct EmbedElem {
|
||||
// We can't distinguish between the two at the moment.
|
||||
#[required]
|
||||
#[parse(
|
||||
match args.find::<Bytes>()? {
|
||||
match args.eat::<Bytes>()? {
|
||||
Some(data) => data,
|
||||
None => engine.world.file(id).at(span)?,
|
||||
}
|
||||
|
@ -28,3 +28,7 @@
|
||||
mime-type: "text/plain",
|
||||
description: "A test file",
|
||||
)
|
||||
|
||||
--- pdf-embed-invalid-data ---
|
||||
// Error: 38-45 expected bytes, found string
|
||||
#pdf.embed("/assets/text/hello.txt", "hello")
|
||||
|
Loading…
x
Reference in New Issue
Block a user