improved pre/list interaction, cleanup
authorGabriel Wicke <gwicke@users.mediawiki.org>
Wed, 14 Jul 2004 18:46:02 +0000 (18:46 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Wed, 14 Jul 2004 18:46:02 +0000 (18:46 +0000)
includes/Parser.php

index 0247134..a1e26cf 100644 (file)
@@ -1261,10 +1261,7 @@ class Parser
                        $lastPrefixLength = strlen( $lastPrefix );
                        $preCloseMatch = preg_match("/<\\/pre/i", $oLine );
                        $preOpenMatch = preg_match("/<pre/i", $oLine );
-                       if (!$this->mInPre) {
-                               $this->mInPre = !empty($preOpenMatch);
-                       }
-                       if ( $preOpenMatch || !$this->mInPre ) {
+                       if ( !$this->mInPre ) {
                                # Multiple prefixes may abut each other for nested lists.
                                $prefixLength = strspn( $oLine, '*#:;' );
                                $pref = substr( $oLine, 0, $prefixLength );
@@ -1272,6 +1269,7 @@ class Parser
                                # eh?
                                $pref2 = str_replace( ';', ':', $pref );
                                $t = substr( $oLine, $prefixLength );
+                               $this->mInPre = !empty($preOpenMatch);
                        } else {
                                # Don't interpret any other prefixes in preformatted text
                                $prefixLength = 0;