diff --git a/crates/typst-library/src/pdf/embed.rs b/crates/typst-library/src/pdf/embed.rs index f902e7f14..4c01cd651 100644 --- a/crates/typst-library/src/pdf/embed.rs +++ b/crates/typst-library/src/pdf/embed.rs @@ -59,7 +59,7 @@ pub struct EmbedElem { // We can't distinguish between the two at the moment. #[required] #[parse( - match args.find::()? { + match args.eat::()? { Some(data) => data, None => engine.world.file(id).at(span)?, } diff --git a/tests/suite/pdf/embed.typ b/tests/suite/pdf/embed.typ index 83f006d63..4546532b7 100644 --- a/tests/suite/pdf/embed.typ +++ b/tests/suite/pdf/embed.typ @@ -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")