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/xhtml.php') 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/xhtml.php') 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 From 91328684db89e336404aff4644f8a53a1db64cad Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sun, 17 Feb 2013 20:32:29 +0100 Subject: Display media file size only if file exists (prevents PHP warning) --- inc/parser/xhtml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/parser/xhtml.php') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 71f3aa4bf..4dd8c5e78 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -803,7 +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 ($exists) $link['title'] .= ' (' . filesize_h(filesize(mediaFN($src))).')'; } if($hash) $link['url'] .= '#'.$hash; -- cgit v1.2.3 From b9b9b28b2edb54f9a3b3c5b9c69fd37a729007ec Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sat, 23 Feb 2013 12:35:57 +0100 Subject: Fix double encoding in rss syntax FS#2731 --- inc/parser/xhtml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/parser/xhtml.php') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 4dd8c5e78..84a999e56 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -889,7 +889,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { // title is escaped by SimplePie, we unescape here because it // is escaped again in externallink() FS#1705 $this->externallink($item->get_permalink(), - htmlspecialchars_decode($item->get_title())); + html_entity_decode($item->get_title(), ENT_QUOTES, 'UTF-8')); }else{ $this->doc .= ' '.$item->get_title(); } -- cgit v1.2.3