summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/handler.php12
-rw-r--r--inc/parser/metadata.php9
-rw-r--r--inc/parser/xhtml.php6
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();