Make list generation state part of the output state.
Which sounds obvious when it's put like that. But I originally did this
in the parser because the parser was tracking lists anyway. But that
made a mess of handling [ordered_list]
and [itemized_list]
, I tried
fixing that but made a pig's ear of it.
The code for handling 'explicit lists' will still be a bit messy because
the generator is currently oblivious to what type of block element it's
generating markup for, and it needs to be aware for lists.