r2965 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r2964‎ | r2965 | r2966 >
Date:14:48, 4 April 2004
Author:gabrielwicke
Status:old
Tags:
Comment:
fixtags hack slightly cleaned up
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -417,11 +417,6 @@
418418 $text = $this->replaceVariables( $text );
419419
420420 # $text = preg_replace( "/(^|\n)-----*/", "\\1<hr>", $text );
421 - $text = str_replace ( "<HR>", "<hr />", $text );
422 - $text = str_replace ( "<br>", "<br />", $text );
423 - $text = str_replace ( "<br >", "<br />", $text );
424 - $text = str_replace ( '<center>', '<span style="text-align: center">', $text );
425 - $text = str_replace ( '</center>', '</span>', $text );
426421
427422 $text = $this->doHeadings( $text );
428423
@@ -438,6 +433,13 @@
439434
440435 $sk =& $this->mOptions->getSkin();
441436 $text = $sk->transformContent( $text );
 437+ $fixtags = array(
 438+ "/<hr *>/i" => '<hr/>',
 439+ "/<br *>/i" => '<br/>',
 440+ "/<center *>/i"=>'<span style="text-align:center;">',
 441+ "/<\\/center *>/i" => '</span>'
 442+ );
 443+ $text = preg_replace( array_keys($fixtags), array_values($fixtags), $text );
442444 $text = $this->doBlockLevels( $text, $linestart );
443445 $text .= $this->categoryMagic () ;
444446
@@ -1272,7 +1274,7 @@
12731275 $htmlpairs = array( # Tags that must be closed
12741276 "b", "i", "u", "font", "big", "small", "sub", "sup", "h1",
12751277 "h2", "h3", "h4", "h5", "h6", "cite", "code", "em", "s",
1276 - "strike", "strong", "tt", "var", "div", "span",
 1278+ "strike", "strong", "tt", "var", "div", "center",
12771279 "blockquote", "ol", "ul", "dl", "table", "caption", "pre",
12781280 "ruby", "rt" , "rb" , "rp", "p"
12791281 );

Status & tagging log