Don't bail on single-line definition list due to excess close tags.
[lhc/web/wiklou.git] / includes / parser / BlockLevelPass.php
index e16cfd4..2ef599a 100644 (file)
@@ -496,10 +496,12 @@ class BlockLevelPass {
                        case self::COLON_STATE_CLOSETAG:
                                # In a </tag>
                                if ( $c === ">" ) {
-                                       $ltLevel--;
-                                       if ( $ltLevel < 0 ) {
+                                       if ( $ltLevel > 0 ) {
+                                               $ltLevel--;
+                                       } else {
+                                               # ignore the excess close tag, but keep looking for
+                                               # colons. (This matches Parsoid behavior.)
                                                wfDebug( __METHOD__ . ": Invalid input; too many close tags\n" );
-                                               return false;
                                        }
                                        $state = self::COLON_STATE_TEXT;
                                }