equal
deleted
inserted
replaced
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); |