From 0155f1f84e51a7acf6c6517c58d009121fa939a1 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Sun, 4 Apr 2004 13:59:45 +0000 Subject: [PATCH] * anchor stripping now positively defined, only a few explicitly defined invalid characters are replaced by _: $canonized_headline = preg_replace("/[ &\\/<>\\(\\)\\[\\]=,+]+/", '_', html_entity_decode(trim( $canonized_headline ))); * additional fixes for closing p's in tables --- includes/Parser.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index 93d92bda87..bb8dff9475 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -377,9 +377,9 @@ class Parser $l = array_pop ( $ltd ) ; if ( array_pop ( $td ) ) $z = "" . $z ; - if ( $fc == "|" ) $l = "TD" ; - else if ( $fc == "!" ) $l = "TH" ; - else if ( $fc == "+" ) $l = "CAPTION" ; + if ( $fc == "|" ) $l = "td" ; + else if ( $fc == "!" ) $l = "th" ; + else if ( $fc == "+" ) $l = "caption" ; else $l = "" ; array_push ( $ltd , $l ) ; $y = explode ( "|" , $theline , 2 ) ; @@ -418,6 +418,8 @@ class Parser # $text = preg_replace( "/(^|\n)-----*/", "\\1
", $text ); $text = str_replace ( "
", "
", $text ); + $text = str_replace ( "
", "
", $text ); + $text = str_replace ( "
", "
", $text ); $text = $this->doHeadings( $text ); @@ -1025,7 +1027,7 @@ class Parser "/(closeParagraph(); $inBlockElem = true; - } else if ( preg_match("/(closeParagraph(); $inBlockElem = false; } @@ -1468,8 +1470,7 @@ class Parser # strip out HTML $canonized_headline = preg_replace( "/<.*?" . ">/","",$canonized_headline ); - $tocline = trim( $canonized_headline ); - $canonized_headline = preg_replace( "/[^a-z0-9]/i", "_", trim( $canonized_headline ) ); + $canonized_headline = preg_replace("/[ &\\/<>\\(\\)\\[\\]=,+]+/", '_', html_entity_decode(trim( $canonized_headline ))); $refer[$headlineCount] = $canonized_headline; # count how many in assoc. array so we can track dupes in anchors -- 2.20.1