includes/wikiengine/render_xhtml.php
changeset 1096 86feb1c7ca3f
parent 1081 745200a9cc2a
child 1106 01315acbc22b
equal deleted inserted replaced
1095:5f623b0de18e 1096:86feb1c7ca3f
    23     'externalnotext' => '<a href="\\1" onclick="window.open(this.href); return false;">\\1</a>'
    23     'externalnotext' => '<a href="\\1" onclick="window.open(this.href); return false;">\\1</a>'
    24   );
    24   );
    25   
    25   
    26   public function heading($text, $pieces)
    26   public function heading($text, $pieces)
    27   {
    27   {
    28     static $tocid = -1;
       
    29     foreach ( $pieces as $i => $piece )
    28     foreach ( $pieces as $i => $piece )
    30     {
    29     {
    31       $tocid++;
    30       $tocid = sanitize_page_id(trim($piece['text']));
    32       $tag = '<h' . $piece['level'] . ' id="toc' . $tocid . '">';
    31       $tag = '<h' . $piece['level'] . ' id="head:' . $tocid . '">';
    33       $tag .= trim($piece['text']);
    32       $tag .= trim($piece['text']);
    34       $tag .= '</h' . $piece['level'] . '>';
    33       $tag .= '</h' . $piece['level'] . '>';
    35       
    34       
    36       $text = str_replace(Carpenter::generate_token($i), $tag, $text);
    35       $text = str_replace(Carpenter::generate_token($i), $tag, $text);
    37     }
    36     }