summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2009-01-12 21:04:28 +0100
committerAndreas Gohr <andi@splitbrain.org>2009-01-12 21:04:28 +0100
commit91df343accb0d06c694dcd613835297cf18867b4 (patch)
tree426bf45b8fb28f9ad6dd3718c99915b29128dcfe
parent7de9cff5dce5558a179b6f9b3379f2bb9a93544c (diff)
downloadrpg-91df343accb0d06c694dcd613835297cf18867b4.tar.gz
rpg-91df343accb0d06c694dcd613835297cf18867b4.tar.bz2
keep hashes for media files FS#673
darcs-hash:20090112200428-7ad00-d13671952bf807d338c8b31b7e0dbe77c077500e.gz
-rw-r--r--inc/parser/xhtml.php8
1 files changed, 7 insertions, 1 deletions
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'];