summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-06-17 13:11:53 +0200
committerAndreas Gohr <andi@splitbrain.org>2006-06-17 13:11:53 +0200
commita966cbde06ef0b40c8fd3fa07c6d98323216bac8 (patch)
treee38ef389227fb695d788a7be3f9d9a08fecc738d /inc
parent63cb5853ff174b45e697ea0818816060805503aa (diff)
downloadrpg-a966cbde06ef0b40c8fd3fa07c6d98323216bac8.tar.gz
rpg-a966cbde06ef0b40c8fd3fa07c6d98323216bac8.tar.bz2
create correct titles for namespace links
Second part of the global start patch series :-) darcs-hash:20060617111153-7ad00-1422551ec64ac84f473a8a5f3adb9cb332bb3f06.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/parser/xhtml.php11
1 files 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;
}