From 274f92661e7c595185768a5c3cdd7c030bd84bb4 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 26 May 2015 15:58:37 +0200 Subject: epub: Skip initial whitespace flow nodes when finding list anchors. They are skipped during layout, so should also be skipped here. Fixes bug 695943. --- source/html/html-layout.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/html/html-layout.c b/source/html/html-layout.c index 3bb1789c..3d34be59 100644 --- a/source/html/html-layout.c +++ b/source/html/html-layout.c @@ -920,7 +920,14 @@ static fz_html_flow *find_list_mark_anchor(fz_context *ctx, fz_html *box) while (box) { if (box->type == BOX_FLOW) - return box->flow_head; + { + fz_html_flow *flow = box->flow_head; + if (flow->type == FLOW_BREAK) + flow = flow->next; + while (flow && flow->type == FLOW_GLUE) + flow = flow->next; + return flow; + } box = box->down; } return NULL; -- cgit v1.2.3