includes/wikiengine/render_xhtml.php
changeset 1096 86feb1c7ca3f
parent 1081 745200a9cc2a
child 1106 01315acbc22b
--- 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'] . '>';