From 0c16b1d365abfa99863514dfab095daed951aec5 Mon Sep 17 00:00:00 2001
From: andi <andi@splitbrain.org>
Date: Mon, 4 Jul 2005 20:49:55 +0200
Subject: [PATCH] relaxed header handling #441

The header handler now doesn't care for the number of closing header
markers. The following lines are all detected as h2 headers:

darcs-hash:20050704184955-9977f-bcf18ece3b66b48638aeb5588613c0283eda4584.gz
---
 inc/parser/handler.php | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index 9865ab526..3ba3d654e 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -103,10 +103,8 @@ class Doku_Handler {
             $level = 1;
         }
         
-        // Strip of the marker for the header, based on the level - the rest is the title
-        $iLevels = array_flip($levels);
-        $markerLen = strlen($iLevels[$level]);
-        $title = substr($match, $markerLen, strlen($match)-($markerLen*2));
+        // Strip markers and whitespaces
+        $title = trim($match,'= ');
         
         $this->_addCall('header',array($title,$level,$pos), $pos);
         $this->meta['section'] = TRUE;
-- 
GitLab