diff --git a/inc/actions.php b/inc/actions.php
index 218a03491cb1d1a36db06585a751d7aab18303d0..6aa29f3bfd5bd79f9e2325e6ae45f1b3143a5f90 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -87,13 +87,18 @@ function act_draftdel($act){
 function act_redirect($id,$preact){
     global $PRE;
     global $TEXT;
+    global $INPUT;
 
     $opts = array(
             'id'       => $id,
             'preact'   => $preact
             );
     //get section name when coming from section edit
-    if($PRE && preg_match('/^\s*==+([^=\n]+)/',$TEXT,$match)){
+    if ($INPUT->has('hid')) {
+        // Use explicitly transmitted header id
+        $opts['fragment'] = $INPUT->str('hid');
+    } else if($PRE && preg_match('/^\s*==+([^=\n]+)/',$TEXT,$match)){
+        // Fallback to old mechanism
         $check = false; //Byref
         $opts['fragment'] = sectionID($match[0], $check);
     }
@@ -114,60 +119,5 @@ function act_redirect_execute($opts){
     send_redirect($go);
 }
 
-/**
- * Validate POST data
- *
- * Validates POST data for a subscribe or unsubscribe request. This is the
- * default action for the event ACTION_HANDLE_SUBSCRIBE.
- *
- * @author Adrian Lang <lang@cosmocode.de>
- *
- * @param array &$params the parameters: target, style and action
- * @throws Exception
- */
-function subscription_handle_post(&$params) {
-    global $INFO;
-    global $lang;
-    /* @var Input $INPUT */
-    global $INPUT;
-
-    // Get and validate parameters.
-    if (!isset($params['target'])) {
-        throw new Exception('no subscription target given');
-    }
-    $target = $params['target'];
-    $valid_styles = array('every', 'digest');
-    if (substr($target, -1, 1) === ':') {
-        // Allow “list” subscribe style since the target is a namespace.
-        $valid_styles[] = 'list';
-    }
-    $style  = valid_input_set('style', $valid_styles, $params,
-                              'invalid subscription style given');
-    $action = valid_input_set('action', array('subscribe', 'unsubscribe'),
-                              $params, 'invalid subscription action given');
-
-    // Check other conditions.
-    if ($action === 'subscribe') {
-        if ($INFO['userinfo']['mail'] === '') {
-            throw new Exception($lang['subscr_subscribe_noaddress']);
-        }
-    } elseif ($action === 'unsubscribe') {
-        $is = false;
-        foreach($INFO['subscribed'] as $subscr) {
-            if ($subscr['target'] === $target) {
-                $is = true;
-            }
-        }
-        if ($is === false) {
-            throw new Exception(sprintf($lang['subscr_not_subscribed'],
-                                        $INPUT->server->str('REMOTE_USER'),
-                                        prettyprint_id($target)));
-        }
-        // subscription_set deletes a subscription if style = null.
-        $style = null;
-    }
-
-    $params = compact('target', 'style', 'action');
-}
 
 //Setup VIM: ex: et ts=2 :
diff --git a/inc/html.php b/inc/html.php
index 2897d01c15e3f07bb99df75f3a279b57e773b90b..a5983ec8751be6ebc8c40b02fdb7ca9cd9df9716 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -91,7 +91,7 @@ function html_denied() {
 function html_secedit($text,$show=true){
     global $INFO;
 
-    $regexp = '#<!-- EDIT(\d+) ([A-Z_]+) (?:"([^"]*)" )?\[(\d+-\d*)\] -->#';
+    $regexp = '#<!-- EDIT(\d+) ([A-Z_]+) (?:"([^"]*)" )(?:"([^"]*)" )?\[(\d+-\d*)\] -->#';
 
     if(!$INFO['writable'] || !$show || $INFO['rev']){
         return preg_replace($regexp,'',$text);
@@ -114,8 +114,9 @@ function html_secedit($text,$show=true){
 function html_secedit_button($matches){
     $data = array('secid'  => $matches[1],
                   'target' => strtolower($matches[2]),
+                  'hid' => strtolower($matches[4]),
                   'range'  => $matches[count($matches) - 1]);
-    if (count($matches) === 5) {
+    if (count($matches) === 6) {
         $data['name'] = $matches[3];
     }
 
@@ -1865,6 +1866,9 @@ function html_edit(){
     }
 
     $form->addHidden('target', $data['target']);
+    if ($INPUT->has('hid')) {
+        $form->addHidden('hid', $INPUT->str('hid'));
+    }
     $form->addElement(form_makeOpenTag('div', array('id'=>'wiki__editbar', 'class'=>'editBar')));
     $form->addElement(form_makeOpenTag('div', array('id'=>'size__ctl')));
     $form->addElement(form_makeCloseTag('div'));
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index e60d7d38b991f3c1b50f846a741a62ca35726912..07db96b1cd0413cddac47bc56e766ab3e368d556 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -66,8 +66,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
      *
      * @author Adrian Lang <lang@cosmocode.de>
      */
-    public function startSectionEdit($start, $type, $title = null) {
-        $this->sectionedits[] = array(++$this->lastsecid, $start, $type, $title);
+    public function startSectionEdit($start, $type, $title = null, $hid = null) {
+        $this->sectionedits[] = array(++$this->lastsecid, $start, $type, $title, $hid);
         return 'sectionedit'.$this->lastsecid;
     }
 
@@ -78,8 +78,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
      *
      * @author Adrian Lang <lang@cosmocode.de>
      */
-    public function finishSectionEdit($end = null) {
-        list($id, $start, $type, $title) = array_pop($this->sectionedits);
+    public function finishSectionEdit($end = null, $hid = null) {
+        list($id, $start, $type, $title, $hid) = array_pop($this->sectionedits);
         if(!is_null($end) && $end <= $start) {
             return;
         }
@@ -87,6 +87,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         if(!is_null($title)) {
             $this->doc .= '"'.str_replace('"', '', $title).'" ';
         }
+        if(!is_null($hid)) {
+            $this->doc .= '"'.$hid.'" ';
+        }
         $this->doc .= "[$start-".(is_null($end) ? '' : $end).'] -->';
     }
 
@@ -217,7 +220,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
         // write the header
         $this->doc .= DOKU_LF.'<h'.$level;
         if($level <= $conf['maxseclevel']) {
-            $this->doc .= ' class="'.$this->startSectionEdit($pos, 'section', $text).'"';
+            $this->doc .= ' class="'.$this->startSectionEdit($pos, 'section', $text, $hid).'"';
         }
         $this->doc .= ' id="'.$hid.'">';
         $this->doc .= $this->_xmlEntities($text);