Add handlers for document,textblocks and linebreak.
Adapt parser code to fire those events.