| @@ 93-105 (lines=13) @@ | ||
| 90 | // but they may be shallower |
|
| 91 | $para_depth = count(explode(' ', str_replace("\t", ' ', $match))); |
|
| 92 | $close_content = true; |
|
| 93 | while ($para_depth < $last_frame['depth'] && count($this->stack) > 1) { |
|
| 94 | if ($close_content) { |
|
| 95 | if ($last_frame['paras']) |
|
| 96 | array_push($output, 'p_close'); |
|
| 97 | array_push($output, "${last_frame['item']}_content_close"); |
|
| 98 | $close_content = false; |
|
| 99 | } |
|
| 100 | array_push($output, |
|
| 101 | "${last_frame['item']}_close", |
|
| 102 | "${last_frame['list']}_close"); |
|
| 103 | array_pop($this->stack); |
|
| 104 | $last_frame = end($this->stack); |
|
| 105 | } |
|
| 106 | if ($last_frame['paras']) { |
|
| 107 | if ($close_content) |
|
| 108 | // depth did not change |
|
| @@ 136-152 (lines=17) @@ | ||
| 133 | // keep popping frames off the stack until we find a frame |
|
| 134 | // that's at least as deep as this one, or until only the |
|
| 135 | // bottom frame (i.e. the initial list markup) remains |
|
| 136 | while ($curr_frame['depth'] < $last_frame['depth'] && |
|
| 137 | count($this->stack) > 1) |
|
| 138 | { |
|
| 139 | // again, we need to close the content tag only for |
|
| 140 | // the first frame popped off the stack |
|
| 141 | if ($close_content) { |
|
| 142 | if ($last_frame['paras']) |
|
| 143 | array_push($output, 'p_close'); |
|
| 144 | array_push($output, "${last_frame['item']}_content_close"); |
|
| 145 | $close_content = false; |
|
| 146 | } |
|
| 147 | array_push($output, |
|
| 148 | "${last_frame['item']}_close", |
|
| 149 | "${last_frame['list']}_close"); |
|
| 150 | array_pop($this->stack); |
|
| 151 | $last_frame = end($this->stack); |
|
| 152 | } |
|
| 153 | // pull the last frame off the stack; |
|
| 154 | // it will be replaced by the current frame |
|
| 155 | array_pop($this->stack); |
|