(bug 2021)(bug 1937) Move dash replacement to a later stage, so that all links are...
authorJens Frank <jeluf@users.mediawiki.org>
Tue, 3 May 2005 04:49:58 +0000 (04:49 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Tue, 3 May 2005 04:49:58 +0000 (04:49 +0000)
includes/Parser.php

index 8027b0a..f286cd6 100644 (file)
@@ -184,13 +184,6 @@ class Parser
 
                $text = $this->internalParse( $text );
 
-               $dashReplace = array(
-                       '/ - /' => "&nbsp;&ndash; ", # N dash
-                       '/(?<=[0-9])-(?=[0-9])/' => "&ndash;", # N dash between numbers
-                       '/ -- /' => "&nbsp;&mdash; " # 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(
+                       '/ - /' => "&nbsp;&ndash; ", # N dash
+                       '/(?<=[0-9])-(?=[0-9])/' => "&ndash;", # N dash between numbers
+                       '/ -- /' => "&nbsp;&mdash; " # 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 <nowiki> mark.