From 91df343accb0d06c694dcd613835297cf18867b4 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 12 Jan 2009 21:04:28 +0100 Subject: keep hashes for media files FS#673 darcs-hash:20090112200428-7ad00-d13671952bf807d338c8b31b7e0dbe77c077500e.gz --- inc/parser/xhtml.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'inc/parser/xhtml.php') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 7ea238f6f..565459220 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -668,6 +668,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { function internalmedia ($src, $title=NULL, $align=NULL, $width=NULL, $height=NULL, $cache=NULL, $linking=NULL) { global $ID; + list($src,$hash) = explode('#',$src,2); resolve_mediaid(getNS($ID),$src, $exists); $noLink = false; @@ -687,6 +688,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $link['url'] = ml($src,array('id'=>$ID,'cache'=>$cache),true); } + if($hash) $link['url'] .= '#'.$hash; + //markup non existing files if (!$exists) $link['class'] .= ' wikilink2'; @@ -698,6 +701,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { function externalmedia ($src, $title=NULL, $align=NULL, $width=NULL, $height=NULL, $cache=NULL, $linking=NULL) { + list($src,$hash) = explode('#',$src,2); $noLink = false; $render = ($linking == 'linkonly') ? false : true; $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render); @@ -714,7 +718,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer { }else{ // add file icons $link['class'] .= ' mediafile mf_'.$ext; - } + } + + if($hash) $link['url'] .= '#'.$hash; //output formatted if ($linking == 'nolink' || $noLink) $this->doc .= $link['name']; -- cgit v1.2.3