I'd like to take a structure like this where each header has a headers and items array:
header
header
\item
item
item
header
header
item
header
item
item
and make it into a list like this:
header
header
item
item
item
header
header
item
header
item
item
I need to be able to handle nested like 6 deep. Right now, I just do an each loop and check for does it have items or does it have headers? But I really don't want to have 6 levels of this- I would like to do some while loop but just not sure how to do it.