diff options
author | Andreas Gohr <andi@splitbrain.org> | 2006-05-07 17:31:13 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2006-05-07 17:31:13 +0200 |
commit | a4a2d4cf66dd68b9dc9ce51064fae2db8385d81d (patch) | |
tree | e17f8afdf47ce8fdd7e098c104ae6477d75fc497 /inc/parser | |
parent | 3aee4c27813a30e720d3ad1fbcbd2e372a88573a (diff) | |
download | rpg-a4a2d4cf66dd68b9dc9ce51064fae2db8385d81d.tar.gz rpg-a4a2d4cf66dd68b9dc9ce51064fae2db8385d81d.tar.bz2 |
metadata hnalding updates, header fixes
This removes the meta instruction again in favour of the new meta renderer.
Most tests work now again, a few tweaks were done on the header handler
to render certain headers as it did in earlier versions.
darcs-hash:20060507153113-7ad00-bd299fbe1762482c72d109f9bca776f12bcea7c8.gz
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/handler.php | 12 | ||||
-rw-r--r-- | inc/parser/metadata.php | 9 | ||||
-rw-r--r-- | inc/parser/xhtml.php | 6 |
3 files changed, 6 insertions, 21 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 702bcce55..fde538515 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -9,10 +9,6 @@ class Doku_Handler { var $calls = array(); - var $meta = array( - 'first_heading' => '', - ); - var $status = array( 'section' => FALSE, ); @@ -43,7 +39,6 @@ class Doku_Handler { trigger_event('PARSER_HANDLER_DONE',$this); array_unshift($this->calls,array('document_start',array(),0)); - array_unshift($this->calls,array('meta',array($this->meta),0)); $last_call = end($this->calls); array_push($this->calls,array('document_end',array(),$last_call[2])); } @@ -87,9 +82,11 @@ class Doku_Handler { function header($match, $state, $pos) { // get level and title - $level = 7 - strspn($match,'='); + $title = trim($match); + $level = 7 - strspn($title,'='); if($level < 1) $level = 1; - $title = trim($match,'= '); + $title = trim($title,'='); + $title = trim($title); if ($this->status['section']) $this->_addCall('section_close',array(),$pos); @@ -97,7 +94,6 @@ class Doku_Handler { $this->_addCall('section_open',array($level),$pos); $this->status['section'] = TRUE; - if (!$this->meta['first_heading']) $this->meta['first_heading'] = $title; return TRUE; } diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php index e7173dda6..59b791fae 100644 --- a/inc/parser/metadata.php +++ b/inc/parser/metadata.php @@ -31,13 +31,6 @@ class Doku_Renderer_metadata extends Doku_Renderer { var $capture = true; var $store = ''; - function meta($data) { - if (is_array($data)){ - $this->meta = $data; - if (!$this->meta['title']) $this->meta['title'] = $data['first_heading']; - } - } - function document_start(){ //reset some variables $this->meta['description']['abstract'] = ''; @@ -60,6 +53,8 @@ class Doku_Renderer_metadata extends Doku_Renderer { function header($text, $level, $pos) { global $conf; + if (!$this->meta['title']) $this->meta['title'] = $text; + // create a unique header id $hid = $this->_headerToLink($text,'true'); diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 682551169..dc28423f9 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -45,12 +45,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { var $store = ''; - var $meta = array(); - - function meta($data) { - if (is_array($data)) $this->meta = $data; - } - function document_start() { //reset some internals $this->toc = array(); |