Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -374,25 +374,26 @@ |
375 | 375 | |
376 | 376 | wfRunHooks( 'ParserBeforeTidy', array( &$this, &$text ) ); |
377 | 377 | |
378 | | -//!JF Move to its own function |
| 378 | + if ( $this->mTransparentTagHooks ) { |
| 379 | + //!JF Move to its own function |
| 380 | + $uniq_prefix = $this->mUniqPrefix; |
| 381 | + $matches = array(); |
| 382 | + $elements = array_keys( $this->mTransparentTagHooks ); |
| 383 | + $text = self::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix ); |
379 | 384 | |
380 | | - $uniq_prefix = $this->mUniqPrefix; |
381 | | - $matches = array(); |
382 | | - $elements = array_keys( $this->mTransparentTagHooks ); |
383 | | - $text = self::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix ); |
384 | | - |
385 | | - foreach( $matches as $marker => $data ) { |
386 | | - list( $element, $content, $params, $tag ) = $data; |
387 | | - $tagName = strtolower( $element ); |
388 | | - if( isset( $this->mTransparentTagHooks[$tagName] ) ) { |
389 | | - $output = call_user_func_array( $this->mTransparentTagHooks[$tagName], |
390 | | - array( $content, $params, $this ) ); |
391 | | - } else { |
392 | | - $output = $tag; |
| 385 | + foreach( $matches as $marker => $data ) { |
| 386 | + list( $element, $content, $params, $tag ) = $data; |
| 387 | + $tagName = strtolower( $element ); |
| 388 | + if( isset( $this->mTransparentTagHooks[$tagName] ) ) { |
| 389 | + $output = call_user_func_array( $this->mTransparentTagHooks[$tagName], |
| 390 | + array( $content, $params, $this ) ); |
| 391 | + } else { |
| 392 | + $output = $tag; |
| 393 | + } |
| 394 | + $this->mStripState->general->setPair( $marker, $output ); |
393 | 395 | } |
394 | | - $this->mStripState->general->setPair( $marker, $output ); |
| 396 | + $text = $this->mStripState->unstripGeneral( $text ); |
395 | 397 | } |
396 | | - $text = $this->mStripState->unstripGeneral( $text ); |
397 | 398 | |
398 | 399 | $text = Sanitizer::normalizeCharReferences( $text ); |
399 | 400 | |
— | — | @@ -4243,7 +4244,9 @@ |
4244 | 4245 | return $oldVal; |
4245 | 4246 | } |
4246 | 4247 | |
| 4248 | + /* An old work-around for bug 2257 - deprecated 2010-02-13 */ |
4247 | 4249 | function setTransparentTagHook( $tag, $callback ) { |
| 4250 | + wfDeprecated( __METHOD__ ); |
4248 | 4251 | $tag = strtolower( $tag ); |
4249 | 4252 | $oldVal = isset( $this->mTransparentTagHooks[$tag] ) ? $this->mTransparentTagHooks[$tag] : null; |
4250 | 4253 | $this->mTransparentTagHooks[$tag] = $callback; |
Index: trunk/extensions/geoserver/geoserver.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | */ |
22 | 22 | function wfGeoServerExtension () { |
23 | 23 | global $wgParser, $wgHooks ; |
24 | | - $wgParser->setTransparentTagHook ( 'geo' , 'parseGeo' ) ; |
| 24 | + $wgParser->setHook ( 'geo' , 'parseGeo' ) ; |
25 | 25 | # $wgHooks['ArticleSaveComplete'][] = 'articleDeleteGeo'; |
26 | 26 | $wgHooks['ArticleDelete'][] = 'articleDeleteGeo'; |
27 | 27 | $wgHooks['ArticleEditUpdatesDeleteFromRecentchanges'][] = 'articleSaveGeo'; |
— | — | @@ -36,8 +36,11 @@ |
37 | 37 | * |
38 | 38 | * Return markup, but also a pointer to Map sources |
39 | 39 | */ |
40 | | -function parseGeo ( $text, $params, &$parser ) { |
| 40 | +function parseGeo ( $text, $params, &$parser, &$frame ) { |
41 | 41 | global $action, $GeoserverParameters, $wgWikiMapsJS; |
| 42 | + |
| 43 | + $text = $parser->recursiveTagParse( $text, $frame ); |
| 44 | + |
42 | 45 | $latpat= '(-?[0-9.]*) *(([0-9.]+) *([0-9.]+)?)? *([NS])'; |
43 | 46 | $lonpat= '(-?[0-9.]*) *(([0-9.]+) *([0-9.]+)?)? *([EW])'; |
44 | 47 | $featcodepat = '(([AHLPRSTUV])\.([A-Z.]*))?'; |