r18403 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r18402‎ | r18403 | r18404 >
Date:16:51, 17 December 2006
Author:vyznev
Status:old
Tags:
Comment:
Change the regexen in doBlockLevels() to handle <center> tags the same as
<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.)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -2123,10 +2123,10 @@
21242124 wfProfileIn( "$fname-paragraph" );
21252125 # No prefix (not in list)--go to paragraph mode
21262126 // XXX: use a stack for nestable elements like span, table and div
2127 - $openmatch = preg_match('/(<table|<blockquote|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<li|<\\/center|<\\/tr|<\\/td|<\\/th)/iS', $t );
 2127+ $openmatch = preg_match('/(<table|<blockquote|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<li|<\\/tr|<\\/td|<\\/th)/iS', $t );
21282128 $closematch = preg_match(
21292129 '/(<\\/table|<\\/blockquote|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6|'.
2130 - '<td|<th|<div|<\\/div|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol|<center)/iS', $t );
 2130+ '<td|<th|<\\/?div|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol|<\\/?center)/iS', $t );
21312131 if ( $openmatch or $closematch ) {
21322132 $paragraphStack = false;
21332133 # TODO bug 5718: paragraph closed
Index: trunk/phase3/RELEASE-NOTES
@@ -336,6 +336,8 @@
337337 * (bug 8274) Wrap edit tools in a <div> with a specified class
338338 * Detect PHP 5.0.x 64-bit bug and abort in WebStart.php; too many things break
339339 mysteriously otherwise (detection code copied from install-utils.inc)
 340+* (bug 8295) Change handling of <center> tags in doBlockLevels() to match that
 341+ of <div>
340342
341343 == Languages updated ==
342344

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r14690* Fix regression(?) in behavior of initial-whitespace-pre in <center>brion21:59, 9 June 2006
r18402Parser test for bug 8293: Use of center tag ruins paragraph formatting....vyznev15:53, 17 December 2006