From 73a4662190c70a99467211532d116afc22ebe8b9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 4 Aug 2004 01:53:29 +0000 Subject: [PATCH] Move magic ISBN, RFC, and GEO links to between replaceExternalLinks and 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 -in- 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 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index a82104e626..6ae7903a7e 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -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 ) -- 2.20.1