From d9e36cbead0f9eaf3ffdd0bd1249dbe39fc9cb30 Mon Sep 17 00:00:00 2001
From: Adrian Lang <lang@cosmocode.de>
Date: Mon, 1 Mar 2010 14:55:47 +0100
Subject: [PATCH] Show last edit section button again

---
 inc/parser/xhtml.php | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 2638cb240..552a8332d 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -58,19 +58,20 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
     /**
      * Finish an edit section range
      *
-     * @param $pos int The byte position for the edit end
+     * @param $end int The byte position for the edit end; null for the rest of
+                       the page
      * @author Adrian Lang <lang@cosmocode.de>
      */
-    protected function finishSectionEdit($end) {
+    protected function finishSectionEdit($end = null) {
         list($id, $start, $type, $title) = array_pop($this->sectionedits);
-        if ($end <= $start) {
+        if (!is_null($end) && $end <= $start) {
             return;
         }
         $this->doc .= "<!-- EDIT$id " . strtoupper($type) . ' ';
         if (!is_null($title)) {
             $this->doc .= '"' . str_replace('"', '', $title) . '" ';
         }
-        $this->doc .= "[$start-" . ($end === 0 ? '' : $end) . '] -->';
+        $this->doc .= "[$start-" . (is_null($end) ? '' : $end) . '] -->';
     }
 
     function getFormat(){
@@ -92,7 +93,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
                 // marker.
                 array_pop($this->sectionedits);
             } else {
-                $this->finishSectionEdit(0);
+                $this->finishSectionEdit();
             }
         }
 
-- 
GitLab