Properly handle nested sublists by folding into previous list item.