From: Jens Frank Date: Tue, 3 May 2005 04:49:58 +0000 (+0000) Subject: (bug 2021)(bug 1937) Move dash replacement to a later stage, so that all links are... X-Git-Tag: 1.5.0alpha1~9 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=0d56da62d3851ce89f9de76635b1fc9d92b63141;p=lhc%2Fweb%2Fwiklou.git (bug 2021)(bug 1937) Move dash replacement to a later stage, so that all links are already stripped --- diff --git a/includes/Parser.php b/includes/Parser.php index 8027b0ac4e..f286cd65f2 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -184,13 +184,6 @@ class Parser $text = $this->internalParse( $text ); - $dashReplace = array( - '/ - /' => " – ", # N dash - '/(?<=[0-9])-(?=[0-9])/' => "–", # N dash between numbers - '/ -- /' => " — " # M dash - ); - $text = preg_replace( array_keys($dashReplace), array_values($dashReplace), $text ); - $text = $this->unstrip( $text, $this->mStripState ); @@ -213,6 +206,13 @@ class Parser $this->replaceLinkHolders( $text ); + $dashReplace = array( + '/ - /' => " – ", # N dash + '/(?<=[0-9])-(?=[0-9])/' => "–", # N dash between numbers + '/ -- /' => " — " # M dash + ); + $text = preg_replace( array_keys($dashReplace), array_values($dashReplace), $text ); + # the position of the convert() call should not be changed. it # assumes that the links are all replaces and the only thing left # is the mark.