Index: trunk/phase3/includes/Parser.php |
— | — | @@ -377,9 +377,9 @@ |
378 | 378 | |
379 | 379 | $l = array_pop ( $ltd ) ; |
380 | 380 | if ( array_pop ( $td ) ) $z = "</{$l}>" . $z ; |
381 | | - if ( $fc == "|" ) $l = "TD" ; |
382 | | - else if ( $fc == "!" ) $l = "TH" ; |
383 | | - else if ( $fc == "+" ) $l = "CAPTION" ; |
| 381 | + if ( $fc == "|" ) $l = "td" ; |
| 382 | + else if ( $fc == "!" ) $l = "th" ; |
| 383 | + else if ( $fc == "+" ) $l = "caption" ; |
384 | 384 | else $l = "" ; |
385 | 385 | array_push ( $ltd , $l ) ; |
386 | 386 | $y = explode ( "|" , $theline , 2 ) ; |
— | — | @@ -418,6 +418,8 @@ |
419 | 419 | |
420 | 420 | # $text = preg_replace( "/(^|\n)-----*/", "\\1<hr>", $text ); |
421 | 421 | $text = str_replace ( "<HR>", "<hr />", $text ); |
| 422 | + $text = str_replace ( "<br>", "<br />", $text ); |
| 423 | + $text = str_replace ( "<br >", "<br />", $text ); |
422 | 424 | |
423 | 425 | $text = $this->doHeadings( $text ); |
424 | 426 | |
— | — | @@ -1025,7 +1027,7 @@ |
1026 | 1028 | "/(<table|<blockquote|<h1|<h2|<h3|<h4|<h5|<h6|<div|<pre)/i", $t ) ) { |
1027 | 1029 | $text .= $this->closeParagraph(); |
1028 | 1030 | $inBlockElem = true; |
1029 | | - } else if ( preg_match("/(<hr)/i", $t ) ) { |
| 1031 | + } else if ( preg_match("/(<hr|<\\/td)/i", $t ) ) { |
1030 | 1032 | $text .= $this->closeParagraph(); |
1031 | 1033 | $inBlockElem = false; |
1032 | 1034 | } |
— | — | @@ -1468,8 +1470,7 @@ |
1469 | 1471 | # strip out HTML |
1470 | 1472 | $canonized_headline = preg_replace( "/<.*?" . ">/","",$canonized_headline ); |
1471 | 1473 | |
1472 | | - $tocline = trim( $canonized_headline ); |
1473 | | - $canonized_headline = preg_replace( "/[^a-z0-9]/i", "_", trim( $canonized_headline ) ); |
| 1474 | + $canonized_headline = preg_replace("/[ &\\/<>\\(\\)\\[\\]=,+]+/", '_', html_entity_decode(trim( $canonized_headline ))); |
1474 | 1475 | $refer[$headlineCount] = $canonized_headline; |
1475 | 1476 | |
1476 | 1477 | # count how many in assoc. array so we can track dupes in anchors |