r2964 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r2963‎ | r2964 | r2965 >
Date:14:15, 4 April 2004
Author:gabrielwicke
Status:old
Tags:
Comment:
tocline was missing
Modified paths:
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -420,6 +420,8 @@
421421 $text = str_replace ( "<HR>", "<hr />", $text );
422422 $text = str_replace ( "<br>", "<br />", $text );
423423 $text = str_replace ( "<br >", "<br />", $text );
 424+ $text = str_replace ( '<center>', '<span style="text-align: center">', $text );
 425+ $text = str_replace ( '</center>', '</span>', $text );
424426
425427 $text = $this->doHeadings( $text );
426428
@@ -1270,7 +1272,7 @@
12711273 $htmlpairs = array( # Tags that must be closed
12721274 "b", "i", "u", "font", "big", "small", "sub", "sup", "h1",
12731275 "h2", "h3", "h4", "h5", "h6", "cite", "code", "em", "s",
1274 - "strike", "strong", "tt", "var", "div", "center",
 1276+ "strike", "strong", "tt", "var", "div", "span",
12751277 "blockquote", "ol", "ul", "dl", "table", "caption", "pre",
12761278 "ruby", "rt" , "rb" , "rp", "p"
12771279 );
@@ -1469,8 +1471,8 @@
14701472
14711473 # strip out HTML
14721474 $canonized_headline = preg_replace( "/<.*?" . ">/","",$canonized_headline );
1473 -
1474 - $canonized_headline = preg_replace("/[ &\\/<>\\(\\)\\[\\]=,+]+/", '_', html_entity_decode(trim( $canonized_headline )));
 1475+ $tocline = trim( $canonized_headline );
 1476+ $canonized_headline = preg_replace("/[ &\\/<>\\(\\)\\[\\]=,+]+/", '_', html_entity_decode( $tocline));
14751477 $refer[$headlineCount] = $canonized_headline;
14761478
14771479 # count how many in assoc. array so we can track dupes in anchors

Status & tagging log