From a1685bed31e846e3ce61dfd2291607fa47ec15f7 Mon Sep 17 00:00:00 2001 From: andi Date: Sat, 14 May 2005 18:06:09 +0200 Subject: do not encode hash char in internal links #322 darcs-hash:20050514160609-9977f-37117d972cb6a61de5c9847c9d9e25a30867f33d.gz --- inc/parser/xhtml.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'inc/parser') 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); -- cgit v1.2.3