Consume data argument in pdf.embed() (#6435)

This commit is contained in:
cAttte 2025-06-12 11:10:04 -03:00 committed by GitHub
parent f9897479d2
commit 4a638f41cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -59,7 +59,7 @@ pub struct EmbedElem {
// We can't distinguish between the two at the moment. // We can't distinguish between the two at the moment.
#[required] #[required]
#[parse( #[parse(
match args.find::<Bytes>()? { match args.eat::<Bytes>()? {
Some(data) => data, Some(data) => data,
None => engine.world.file(id).at(span)?, None => engine.world.file(id).at(span)?,
} }

View File

@ -28,3 +28,7 @@
mime-type: "text/plain", mime-type: "text/plain",
description: "A test file", description: "A test file",
) )
--- pdf-embed-invalid-data ---
// Error: 38-45 expected bytes, found string
#pdf.embed("/assets/text/hello.txt", "hello")