From 3755fc25fd2934f8d887f713a48b342ef252cfee Mon Sep 17 00:00:00 2001 From: Tom N Harris Date: Mon, 14 Mar 2011 20:39:30 -0400 Subject: Combine subsequent calls to strtr into a single transformation --- inc/parser/renderer.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'inc/parser') diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php index 2c78f220a..7df369478 100644 --- a/inc/parser/renderer.php +++ b/inc/parser/renderer.php @@ -274,9 +274,10 @@ class Doku_Renderer extends DokuWiki_Plugin { list($name,$hash) = explode('#',$name,2); if($hash) return $hash; - $name = strtr($name,';',':'); if($conf['useslash']){ - $name = strtr($name,'/',':'); + $name = strtr($name,';/',';:'); + }else{ + $name = strtr($name,';',':'); } return noNSorNS($name); -- cgit v1.2.3 From b04a190d960a260703e65e9ed4a951cb083e4e61 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sun, 2 Dec 2012 23:58:38 +0100 Subject: XHTML renderer: bind section id counter to the renderer instance This changes the previously static lastsecid into an instance variable, this leads to consistent section edit ids when the xhtml renderer is used more than once in a request. This makes it possible for test cases to know the exact section edit id for an instruction array. --- inc/parser/xhtml.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc/parser') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index b4e78a530..68b92ca43 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -30,6 +30,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { var $toc = array(); // will contain the Table of Contents var $sectionedits = array(); // A stack of section edit data + private $lastsecid = 0; // last section edit id, used by startSectionEdit var $headers = array(); var $footnotes = array(); @@ -50,9 +51,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer { * @author Adrian Lang */ public function startSectionEdit($start, $type, $title = null) { - static $lastsecid = 0; - $this->sectionedits[] = array(++$lastsecid, $start, $type, $title); - return 'sectionedit' . $lastsecid; + $this->sectionedits[] = array(++$this->lastsecid, $start, $type, $title); + return 'sectionedit' . $this->lastsecid; } /** -- cgit v1.2.3 From ffb060ea6b02211074dfc314f8651936065b3f7f Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Wed, 9 Jan 2013 21:09:42 +0100 Subject: show filesize of local file links in tooltip --- inc/parser/xhtml.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc/parser') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 68b92ca43..71f3aa4bf 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -803,6 +803,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext); $link['class'] .= ' mediafile mf_'.$class; $link['url'] = ml($src,array('id'=>$ID,'cache'=>$cache),true); + $link['title'] .= ' (' . filesize_h(filesize(mediaFN($src))).')'; } if($hash) $link['url'] .= '#'.$hash; -- cgit v1.2.3