includes/wikiengine/render_xhtml.php
changeset 1127 4b858862c35c
parent 1106 01315acbc22b
child 1156 417e66a664d0
equal deleted inserted replaced
1125:367768040a61 1127:4b858862c35c
    27   public function heading($text, $pieces)
    27   public function heading($text, $pieces)
    28   {
    28   {
    29     foreach ( $pieces as $i => $piece )
    29     foreach ( $pieces as $i => $piece )
    30     {
    30     {
    31       $tocid = sanitize_page_id(trim($piece['text']));
    31       $tocid = sanitize_page_id(trim($piece['text']));
       
    32       // (bad) workaround for links in headings
       
    33       $tocid = str_replace(array('[', ']'), '', $tocid);
    32       $tag = '<h' . $piece['level'] . ' id="head:' . $tocid . '">';
    34       $tag = '<h' . $piece['level'] . ' id="head:' . $tocid . '">';
    33       $tag .= trim($piece['text']);
    35       $tag .= trim($piece['text']);
    34       $tag .= '</h' . $piece['level'] . '>';
    36       $tag .= '</h' . $piece['level'] . '>';
    35       
    37       
    36       $text = str_replace(Carpenter::generate_token($i), $tag, $text);
    38       $text = str_replace(Carpenter::generate_token($i), $tag, $text);