Change the regexen in doBlockLevels() to handle <center> tags the same as
authorIlmari Karonen <vyznev@users.mediawiki.org>
Sun, 17 Dec 2006 16:51:01 +0000 (16:51 +0000)
committerIlmari Karonen <vyznev@users.mediawiki.org>
Sun, 17 Dec 2006 16:51:01 +0000 (16:51 +0000)
<div>.  This fixes bug 8293: Use of center tag ruins paragraph formatting,
but COULD SOMEONE PLEASE EXPLAIN TO ME WHY??!?  Trying to make sense of
that code gives me a headache.  (Ps. See also related change in r14690.)

RELEASE-NOTES
includes/Parser.php

index 1c63875..83400e3 100644 (file)
@@ -336,6 +336,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 8274) Wrap edit tools in a <div> with a specified class
 * Detect PHP 5.0.x 64-bit bug and abort in WebStart.php; too many things break
   mysteriously otherwise (detection code copied from install-utils.inc)
+* (bug 8295) Change handling of <center> tags in doBlockLevels() to match that
+  of <div>
 
 == Languages updated ==
 
index 7e594f1..9a0331d 100644 (file)
@@ -2123,10 +2123,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|<\\/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|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol|<\\/?center)/iS', $t );
                                if ( $openmatch or $closematch ) {
                                        $paragraphStack = false;
                                        # TODO bug 5718: paragraph closed