From be8e969031349a70768ee375e09fc6156c41c54e Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Tue, 23 Jan 2018 00:12:16 +0100 Subject: [PATCH] Fix named pages when broken between two top-level children Fix #507. --- weasyprint/layout/blocks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weasyprint/layout/blocks.py b/weasyprint/layout/blocks.py index b4191432..1297dbc6 100644 --- a/weasyprint/layout/blocks.py +++ b/weasyprint/layout/blocks.py @@ -784,6 +784,9 @@ def block_container_layout(context, box, max_position_y, skip_stack, min(new_box.height, new_box.max_height), new_box.min_height) + if next_page['page'] is None: + next_page['page'] = new_box.page_values()[1] + return new_box, resume_at, next_page, adjoining_margins, collapsing_through