| @@ 104-116 (lines=13) @@ | ||
| 101 | // but they may be shallower |
|
| 102 | $para_depth = count(explode(' ', str_replace("\t", ' ', $match))); |
|
| 103 | $close_content = true; |
|
| 104 | while($para_depth < $last_frame['depth'] && count($this->stack) > 1) { |
|
| 105 | if($close_content) { |
|
| 106 | if($last_frame['paras']) { |
|
| 107 | array_push($output, 'p_close'); |
|
| 108 | } |
|
| 109 | array_push($output, "${last_frame['item']}_content_close"); |
|
| 110 | $close_content = false; |
|
| 111 | } |
|
| 112 | array_push( |
|
| 113 | $output, |
|
| 114 | "${last_frame['item']}_close", |
|
| 115 | "${last_frame['list']}_close" |
|
| 116 | ); |
|
| 117 | array_pop($this->stack); |
|
| 118 | $last_frame = end($this->stack); |
|
| 119 | } |
|
| @@ 156-172 (lines=17) @@ | ||
| 153 | // keep popping frames off the stack until we find a frame |
|
| 154 | // that's at least as deep as this one, or until only the |
|
| 155 | // bottom frame (i.e. the initial list markup) remains |
|
| 156 | while($curr_frame['depth'] < $last_frame['depth'] && |
|
| 157 | count($this->stack) > 1) { |
|
| 158 | // again, we need to close the content tag only for |
|
| 159 | // the first frame popped off the stack |
|
| 160 | if($close_content) { |
|
| 161 | if($last_frame['paras']) { |
|
| 162 | array_push($output, 'p_close'); |
|
| 163 | } |
|
| 164 | array_push($output, "${last_frame['item']}_content_close"); |
|
| 165 | $close_content = false; |
|
| 166 | } |
|
| 167 | array_push( |
|
| 168 | $output, |
|
| 169 | "${last_frame['item']}_close", |
|
| 170 | "${last_frame['list']}_close" |
|
| 171 | ); |
|
| 172 | array_pop($this->stack); |
|
| 173 | $last_frame = end($this->stack); |
|
| 174 | } |
|
| 175 | // pull the last frame off the stack; |
|