Fix issue with two consecutive blocks of the same type

The second block was not detected properly.
The issue appears for block that have a start and a end tag.