From 12dbb2267d0bed41790857fb189f26c053043746 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Wed, 13 Jul 2005 15:17:28 +0000 Subject: [PATCH] Fix #785 : properly get out of a
 element :p

---
 RELEASE-NOTES       | 1 +
 includes/Parser.php | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 6db852dbd7..fda0cec120 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -568,6 +568,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new.
 * With $wgCapitalLinks off, accept off-by-first-letter-case in 'go' match
 * Optional parameters for [[Special:Listusers]]
 * (bug 2832) [[Special:Listadmins]] redirects to [[Special:Listusers/sysop]]
+* (bug 785) Parser did not get out of 
 with list elements
 
 === Caveats ===
 
diff --git a/includes/Parser.php b/includes/Parser.php
index 720c2da874..b522524d0e 100644
--- a/includes/Parser.php
+++ b/includes/Parser.php
@@ -1753,9 +1753,6 @@ class Parser
 				if ( $openmatch or $closematch ) {
 					$paragraphStack = false;
 					$output .= $this->closeParagraph();
-					if($preOpenMatch and !$preCloseMatch) {
-						$this->mInPre = true;
-					}
 					if ( $closematch ) {
 						$inBlockElem = false;
 					} else {
@@ -1800,6 +1797,10 @@ class Parser
 				}
 				wfProfileOut( "$fname-paragraph" );
 			}
+			// somewhere above we forget to get out of pre block (bug 785)
+			if($preCloseMatch && $this->mInPre) {
+				$this->mInPre = false;
+			}
 			if ($paragraphStack === false) {
 				$output .= $t."\n";
 			}
-- 
2.20.1