function _finalize()
{
$this->CallWriter->finalise();
if ($this->status['section']) {
$last_call = end($this->calls);
array_push($this->calls, array('section_close', array(), $last_call[2]));
}
if ($this->rewriteBlocks) {
$B = new Doku_Handler_Block();
$this->calls = $B->process($this->calls);
}
trigger_event('PARSER_HANDLER_DONE', $this);
array_unshift($this->calls, array('document_start', array(), 0));
$last_call = end($this->calls);
array_push($this->calls, array('document_end', array(), $last_call[2]));
}