Move magic ISBN, RFC, and GEO links to between replaceExternalLinks and
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 4 Aug 2004 01:53:29 +0000 (01:53 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 4 Aug 2004 01:53:29 +0000 (01:53 +0000)
replaceInternalLinks. This is a basic fix for the infamous bug
[ 708163 ] [[ISBN #]] doesn't work correctly

ISBN, RFC links accidentally put inside [[ ]] brackets will now come up
relatively straightforwardly, with extra brackets. This is much nicer
than a horror of HTML errors that there were before; does not solve
problem with embedded <a>-in-<a> tag if you put it in a link piped
text, but that's a smaller problem.

Someday a full tokenized parser will wish this problem away into the
cornfields.

includes/Parser.php

index a82104e..6ae7903 100644 (file)
@@ -828,13 +828,11 @@ class Parser
                $text = $this->doAllQuotes( $text );
                // $text = $this->doExponent( $text );
                $text = $this->replaceExternalLinks( $text );
+               $text = $this->doMagicLinks( $text );
                $text = $this->replaceInternalLinks ( $text );
                $text = $this->replaceInternalLinks ( $text );
                //$text = $this->doTokenizedParser ( $text );
-               $text = $this->doTableStuff ( $text ) ;
-               $text = $this->magicISBN( $text );
-               $text = $this->magicGEO( $text );
-               $text = $this->magicRFC( $text );
+               $text = $this->doTableStuff( $text );
                $text = $this->formatHeadings( $text, $isMain );
                $sk =& $this->mOptions->getSkin();
                $text = $sk->transformContent( $text );
@@ -847,6 +845,13 @@ class Parser
                wfProfileOut( $fname );
                return $text;
        }
+       
+       /* private */ function &doMagicLinks( &$text ) {
+               $text = $this->magicISBN( $text );
+               $text = $this->magicGEO( $text );
+               $text = $this->magicRFC( $text );
+               return $text;
+       }
 
        # Parse ^^ tokens and return html
        /* private */ function doExponent ( $text )