summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'].='&s=';
$link['url'] .= urlencode($search);
}
+ //keep hash
+ if($hash) $link['url'].='#'.$hash;
+
//output formatted
if($returnonly){
return $this->_formatLink($link);