diff options
Diffstat (limited to 'inc/parser/handler.php')
-rw-r--r-- | inc/parser/handler.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php index a0adb24d5..519336caa 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -34,8 +34,10 @@ class Doku_Handler { if ( $this->status['section'] ) { $last_call = end($this->calls); array_push($this->calls,array('section_close',array(), $last_call[2])); - array_push($this->calls,array('section_edit',array($this->status['section_edit_start'], 0, - $this->status['section_edit_level'], $this->status['section_edit_title']), $last_call[2])); + if ($this->status['section_edit_start']>1) { + // ignore last edit section if there is only one header + array_push($this->calls,array('section_edit',array($this->status['section_edit_start'], 0, $this->status['section_edit_level'], $this->status['section_edit_title']), $last_call[2])); + } } if ( $this->rewriteBlocks ) { @@ -88,6 +90,8 @@ class Doku_Handler { } function header($match, $state, $pos) { + global $conf; + // get level and title $title = trim($match); $level = 7 - strspn($title,'='); @@ -97,10 +101,12 @@ class Doku_Handler { if ($this->status['section']) $this->_addCall('section_close',array(),$pos); - $this->_addCall('section_edit',array($this->status['section_edit_start'], $pos-1, $this->status['section_edit_level'], $this->status['section_edit_title']), $pos); - $this->status['section_edit_start'] = $pos; - $this->status['section_edit_level'] = $level; - $this->status['section_edit_title'] = $title; + if ($level<=$conf['maxseclevel']) { + $this->_addCall('section_edit',array($this->status['section_edit_start'], $pos-1, $this->status['section_edit_level'], $this->status['section_edit_title']), $pos); + $this->status['section_edit_start'] = $pos; + $this->status['section_edit_level'] = $level; + $this->status['section_edit_title'] = $title; + } $this->_addCall('header',array($title,$level,$pos), $pos); |