From 0d56da62d3851ce89f9de76635b1fc9d92b63141 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Tue, 3 May 2005 04:49:58 +0000 Subject: [PATCH] (bug 2021)(bug 1937) Move dash replacement to a later stage, so that all links are already stripped --- includes/Parser.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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. -- 2.20.1