From a966cbde06ef0b40c8fd3fa07c6d98323216bac8 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 17 Jun 2006 13:11:53 +0200 Subject: create correct titles for namespace links Second part of the global start patch series :-) darcs-hash:20060617111153-7ad00-1422551ec64ac84f473a8a5f3adb9cb332bb3f06.gz --- inc/parser/xhtml.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index e540430a3..5f6bb5539 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -944,14 +944,21 @@ class Doku_Renderer_xhtml extends Doku_Renderer { function _simpleTitle($name){ global $conf; + //if there is a hash we use the ancor name only + list($name,$hash) = explode('#',$name,2); + if($hash) return $hash; + + //trim colons of a namespace link + $name = rtrim($name,':'); + if($conf['useslash']){ $nssep = '[:;/]'; }else{ $nssep = '[:;]'; } $name = preg_replace('!.*'.$nssep.'!','',$name); - //if there is a hash we use the ancor name only - $name = preg_replace('!.*#!','',$name); + + if(!$name) return $this->_simpleTitle($conf['start']); return $name; } -- cgit v1.2.3