@@ -45,22 +45,26 @@ |
||
| 45 | 45 | |
| 46 | 46 | sscanf($heading->getName(), 'h%u', $curr); |
| 47 | 47 | |
| 48 | - if (!($hMin <= $curr && $curr <= $hMax)) { |
|
| 48 | + if (!($hMin <= $curr && $curr <= $hMax)) |
|
| 49 | + { |
|
| 49 | 50 | continue; |
| 50 | 51 | } |
| 51 | 52 | |
| 52 | 53 | $headingID = $heading->attributes()->id; |
| 53 | 54 | |
| 54 | 55 | // If the current level is greater than the last level indent one level |
| 55 | - if ($curr > $last) { |
|
| 56 | + if ($curr > $last) |
|
| 57 | + { |
|
| 56 | 58 | $toc .= '<ul>'; |
| 57 | 59 | } |
| 58 | 60 | // If the current level is less than the last level go up appropriate amount. |
| 59 | - elseif ($curr < $last) { |
|
| 61 | + elseif ($curr < $last) |
|
| 62 | + { |
|
| 60 | 63 | $toc .= str_repeat('</li></ul>', $last - $curr) . '</li>'; |
| 61 | 64 | } |
| 62 | 65 | // If the current level is equal to the last. |
| 63 | - else { |
|
| 66 | + else |
|
| 67 | + { |
|
| 64 | 68 | $toc .= '</li>'; |
| 65 | 69 | } |
| 66 | 70 | |