* Fix regression(?) in behavior of initial-whitespace-pre in <center>
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Jun 2006 21:59:26 +0000 (21:59 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 9 Jun 2006 21:59:26 +0000 (21:59 +0000)
RELEASE-NOTES
includes/Parser.php
maintenance/parserTests.txt

index fa0058d..fac93fb 100644 (file)
@@ -469,6 +469,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 6254) Update to Indonesian translation (id) #20
 * (bug 6255) Fix transclusions starting with "#" or "*" in HTML attributes
 * Whitespace now normalized more or less properly in HTML attributes
+* Fix regression(?) in behavior of initial-whitespace-pre in <center>
 
 
 == Compatibility ==
index db6e273..60aaaed 100644 (file)
@@ -1891,10 +1891,10 @@ class Parser
                                wfProfileIn( "$fname-paragraph" );
                                # No prefix (not in list)--go to paragraph mode
                                // XXX: use a stack for nestable elements like span, table and div
-                               $openmatch = preg_match('/(<table|<blockquote|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<li|<center|<\\/tr|<\\/td|<\\/th)/iS', $t );
+                               $openmatch = preg_match('/(<table|<blockquote|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<li|<\\/center|<\\/tr|<\\/td|<\\/th)/iS', $t );
                                $closematch = preg_match(
                                        '/(<\\/table|<\\/blockquote|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6|'.
-                                       '<td|<th|<div|<\\/div|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol|<\\/center)/iS', $t );
+                                       '<td|<th|<div|<\\/div|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol|<center)/iS', $t );
                                if ( $openmatch or $closematch ) {
                                        $paragraphStack = false;
                                        # TODO bug 5718: paragraph closed
index 489729b..f40e31a 100644 (file)
@@ -313,6 +313,20 @@ And a <a href="/wiki/Main_Page" title="Main Page">link</a>
 
 !! end
 
+!! test
+Regression with preformatted in <center>
+!! input
+<center>
+ Blah
+</center>
+!! result
+<center>
+<pre>Blah
+</pre>
+</center>
+
+!! end
+
 !! test
 <pre> with attributes (bug 3202)
 !! input