Skip to content

Commit

Permalink
fix: make nested includes work correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
OrangeX4 committed Apr 5, 2024
1 parent 3d6006c commit a7f3f7b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions slide.typ
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit a7f3f7b

Please sign in to comment.