Floki parse and group by heading

The situation is like your number 2 point. After the H2 it just random amount p tags nothing else.
I will need to figure out how to write a reducer first. And then a reducer for situation number 2.