Changeset 370945
- Timestamp:
- 04/09/2011 04:34:57 PM (15 years ago)
- File:
-
- 1 edited
-
wordpress-wiki/trunk/controllers/wiki_pages.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-wiki/trunk/controllers/wiki_pages.php
r370944 r370945 65 65 } 66 66 67 preg_match_all("|<h2 >(.*)</h2>|", $content, $h2s, PREG_PATTERN_ORDER);68 $content = preg_replace("|<h2 >(.*)</h2>|", "<a name='$1'></a><h2>$1</h2>", $content);69 $content = preg_replace("|<h3 >(.*)</h3>|", "<a name='$1'></a><h3>$1</h3>", $content);67 preg_match_all("|<h2.*>(.*)</h2>|", $content, $h2s, PREG_PATTERN_ORDER); 68 $content = preg_replace("|<h2.*>(.*)</h2>|", "<a name='$1'></a><h2>$1</h2>", $content); 69 $content = preg_replace("|<h3.*>(.*)</h3>|", "<a name='$1'></a><h3>$1</h3>", $content); 70 70 $h2s = $h2s[1]; 71 71 $content = str_replace("\n", "::newline::", $content); 72 preg_match_all("|</h2 >(.*)<h2>|U", $content, $h3s_contents, PREG_PATTERN_ORDER);72 preg_match_all("|</h2.*>(.*)<h2>|U", $content, $h3s_contents, PREG_PATTERN_ORDER); 73 73 74 74 //The following lines are really ugly for finding <h3> after the last </h2> please tidy it up if u know a better solution, and please let us know about it. … … 82 82 } 83 83 array_push($h3s_contents[1], $last_h2_pos); 84 <<<<<<< HEAD 84 85 foreach ($h3s_contents[1] as $key => $h3s_content) { 85 86 preg_match_all("|<h3>(.*)</h3>|U", $h3s_content, $h3s[$key], PREG_PATTERN_ORDER); 86 87 } 88 ======= 89 foreach ($h3s_contents[1] as $key => $h3s_content) { 90 preg_match_all("|<h3.*>(.*)</h3>|U", $h3s_content, $h3s[$key], PREG_PATTERN_ORDER); 91 } 92 >>>>>>> fixed TOC regex 87 93 $table = "<ol class='content_list'>"; 88 94 foreach($h2s as $key => $h2) {
Note: See TracChangeset
for help on using the changeset viewer.