Queue top figures and flow following text around them

This commit is contained in:
gloamxun committed 2026-10-19 14:28:49 +08:00
1 parent 5a54386dee
commit 23cf1f13de
6 files changed
+131 -24

No files matched your search

+16
View File
@@ -347,6 +347,22 @@ After text.
"[t] figure on page 1"
);
assert!(page_svg(&top, 1).contains("<image"), "[t] figure missing");
assert!(
page_svg(&top, 0).contains("After"),
"[t] text after the float should fill page 1: {}",
page_svg(&top, 0)
);
let top_image_y = page_svg(&top, 1)
.split("<image")
.nth(1)
.and_then(|rest| rest.split("y=\"").nth(1))
.and_then(|rest| rest.split("\"").next())
.and_then(|value| value.parse::<f64>().ok())
.unwrap_or_else(|| panic!("[t] image has no y coordinate: {}", page_svg(&top, 1)));
assert!(
top_image_y < 30.0,
"[t] figure was not placed at the top of page 2: {top_image_y}"
);
let here = compile("h");
assert_eq!(here["status"], "ok", "{}", here["message"]);