summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {