summaryrefslogtreecommitdiff
path: root/render/box_construct.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-07-18 09:20:07 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2014-07-18 09:20:07 +0100
commitb1eb026c6e3f4e941e60fabe65445263afcad03b (patch)
tree04f7af1bbd9686b3ebeab7cee0c3dae5a2b57b67 /render/box_construct.c
parent5b4d38b29b6b69a0cab20e094727b3ba2055d761 (diff)
downloadnetsurf-b1eb026c6e3f4e941e60fabe65445263afcad03b.tar.gz
netsurf-b1eb026c6e3f4e941e60fabe65445263afcad03b.tar.bz2
Fix bug #2154: List numbering.
Previous list item box may not always be last child of parent. Search its previous children until a list item is found.
Diffstat (limited to 'render/box_construct.c')
-rw-r--r--render/box_construct.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index ddb02e3e5..3404ca460 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -507,11 +507,20 @@ static bool box_construct_marker(struct box *box, const char *title,
* BOX_BLOCK <-- list box
* ...
*/
- while (last != NULL) {
- if (last->list_marker != NULL)
- break;
+ while (last != NULL && last->list_marker == NULL) {
+ struct box *last_inner = last;
+
+ while (last_inner != NULL) {
+ if (last_inner->list_marker != NULL)
+ break;
- last = last->last;
+ last_inner = last_inner->last;
+ }
+ if (last_inner != NULL) {
+ last = last_inner;
+ } else {
+ last = last->prev;
+ }
}
if (last && last->list_marker) {