From a7f3f7b8474c6522c509c2aff416bf1df13d6d28 Mon Sep 17 00:00:00 2001 From: OrangeX4 <318483724@qq.com> Date: Fri, 5 Apr 2024 23:39:39 +0800 Subject: [PATCH] fix: make nested includes work correctly --- slide.typ | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/slide.typ b/slide.typ index 32b6ee500..1757f7850 100644 --- a/slide.typ +++ b/slide.typ @@ -484,10 +484,15 @@ let (section, subsection, title, slide) = (none, none, none, ()) let last-title = none let children = if utils.is-sequence(body) { body.children } else { (body,) } - // flatten children - children = children.map(it => { - if utils.is-sequence(it) { it.children } else { it } - }).flatten() + // convert all sequence to array recursively, and then flatten the array + let sequence-to-array(it) = { + if utils.is-sequence(it) { + it.children.map(sequence-to-array) + } else { + it + } + } + children = children.map(sequence-to-array).flatten() // trim space of children children = utils.trim(children) if children.len() == 0 { return none }