Wiki formatter: heading IDs are now name based ("head:" . sanitize_page_id($text)) instead of tocN.
authorDan
Fri, 21 Aug 2009 15:39:23 -0400
changeset 1096 86feb1c7ca3f
parent 1095 5f623b0de18e
child 1097 4252e4d83102
Wiki formatter: heading IDs are now name based ("head:" . sanitize_page_id($text)) instead of tocN.
includes/wikiengine/render_xhtml.php
--- a/includes/wikiengine/render_xhtml.php	Fri Aug 21 15:38:40 2009 -0400
+++ b/includes/wikiengine/render_xhtml.php	Fri Aug 21 15:39:23 2009 -0400
@@ -25,11 +25,10 @@
   
   public function heading($text, $pieces)
   {
-    static $tocid = -1;
     foreach ( $pieces as $i => $piece )
     {
-      $tocid++;
-      $tag = '<h' . $piece['level'] . ' id="toc' . $tocid . '">';
+      $tocid = sanitize_page_id(trim($piece['text']));
+      $tag = '<h' . $piece['level'] . ' id="head:' . $tocid . '">';
       $tag .= trim($piece['text']);
       $tag .= '</h' . $piece['level'] . '>';