From 8c7ea6377e159fc852c5bda824ce76640f4ca0f4 Mon Sep 17 00:00:00 2001 From: Luigi Pinna Date: Mon, 9 Nov 2026 03:13:54 +0100 Subject: [PATCH] test(content): the #2456 tests use a filtered inline image (#2483) --- crates/render/src/text/tests.rs | 5 +++-- vendor/hayro-syntax/src/content/mod.rs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/render/src/text/tests.rs b/crates/render/src/text/tests.rs index 6012672680..9e7c7a7093 100644 --- a/crates/render/src/text/tests.rs +++ b/crates/render/src/text/tests.rs @@ -195,9 +195,10 @@ fn redraws_of_a_long_replacement_share_a_text_budget() { fn text_after_an_inline_image_survives_a_non_ascii_byte_before_a_later_ei() { // Everyday content both ways: a string with a byte above 0x7F, and a later word holding // a capital "EI". The end-of-data look-ahead used to read the string's bytes as image - // data, so the image swallowed the rest of the page. + // data, so the image swallowed the rest of the page. The image is filtered, so its + // length isn't known up front and the look-ahead decides. let pdf = marked_pages(&[ - "BI /W 1 /H 1 /BPC 8 /CS /DeviceGray ID \0 EI BT /F1 20 Tf 1 0 0 1 20 200 Tm (Gr\u{fc}\u{df}e) Tj 1 0 0 1 20 150 Tm (EINGANG) Tj ET", + "BI /W 1 /H 1 /BPC 8 /CS /DeviceGray /F /AHx ID 00> EI BT /F1 20 Tf 1 0 0 1 20 200 Tm (Gr\u{fc}\u{df}e) Tj 1 0 0 1 20 150 Tm (EINGANG) Tj ET", ]); assert!(marked_text(&pdf, 0).plain_text().contains("EINGANG"), "the text after the inline image was not extracted"); diff --git a/vendor/hayro-syntax/src/content/mod.rs b/vendor/hayro-syntax/src/content/mod.rs index 1d71d73d2e..f0805c9b5e 100644 --- a/vendor/hayro-syntax/src/content/mod.rs +++ b/vendor/hayro-syntax/src/content/mod.rs @@ -1170,8 +1170,9 @@ mod tests { #[test] fn an_inline_image_ends_at_its_own_ei_when_later_text_holds_a_non_ascii_byte() { // `(Grüße)` in WinAnsi, then a word holding a capital "EI": both are everyday content, - // and the look-ahead used to read the non-ASCII bytes of the string as image data. - let data = b"BI /W 1 /H 1 /BPC 8 /CS /DeviceGray ID \x00 EI BT /F1 12 Tf (Gr\xFC\xDFe) Tj (EINGANG) Tj ET"; + // and the look-ahead used to read the non-ASCII bytes of the string as image data. The + // image is filtered, so its length isn't known up front and the look-ahead decides. + let data = b"BI /W 1 /H 1 /BPC 8 /CS /DeviceGray /F /AHx ID 00> EI BT /F1 12 Tf (Gr\xFC\xDFe) Tj (EINGANG) Tj ET"; assert_eq!( operators(data),