diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index fdf384a621adeb88be9b01e82e19d62a6d9efafa..102958c9d3a31e9e27fc82a41a93ac57fb0bb9ae 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -516,7 +516,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
 
         //keep hash anchor
         list($id,$hash) = explode('#',$id,2);
-        $hash = $this->_headerToLink($hash);
+        if(!empty($hash)) $hash = $this->_headerToLink($hash);
 
         //prepare for formating
         $link['target'] = $conf['target']['wiki'];