Code Duplication    Length = 13-17 lines in 2 locations

syntax.php 2 locations

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