summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-05-14 18:06:09 +0200
committerandi <andi@splitbrain.org>2005-05-14 18:06:09 +0200
commita1685bed31e846e3ce61dfd2291607fa47ec15f7 (patch)
tree6da05d08c56b0f53c172e7ee9629ff91df13d8f0 /inc/parser
parentd7be624595b8c52bc0e6c90d5286d787caaf1515 (diff)
downloadrpg-a1685bed31e846e3ce61dfd2291607fa47ec15f7.tar.gz
rpg-a1685bed31e846e3ce61dfd2291607fa47ec15f7.tar.bz2
do not encode hash char in internal links #322
darcs-hash:20050514160609-9977f-37117d972cb6a61de5c9847c9d9e25a30867f33d.gz
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/xhtml.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index e585f346e..f9f6be1e6 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -443,7 +443,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
function internallink($id, $name = NULL, $search=NULL,$returnonly=false) {
global $conf;
global $ID;
-
// default name is based on $id as given
$default = $this->_simpleTitle($id);
// now first resolve and clean up the $id
@@ -458,7 +457,10 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
} else {
$class='media';
}
-
+
+ //keep hash anchor
+ list($id,$hash) = split('#',$id,2);
+
//prepare for formating
$link['target'] = $conf['target']['wiki'];
$link['style'] = '';
@@ -474,13 +476,15 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['url'] = wl($id);
$link['name'] = $name;
$link['title'] = $id;
-
//add search string
if($search){
($conf['userewrite']) ? $link['url'].='?s=' : $link['url'].='&amp;s=';
$link['url'] .= urlencode($search);
}
+ //keep hash
+ if($hash) $link['url'].='#'.$hash;
+
//output formatted
if($returnonly){
return $this->_formatLink($link);