Index: trunk/extensions/ArticleEmblems/ArticleEmblems.hooks.php |
— | — | @@ -35,25 +35,6 @@ |
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | | - * ParserBeforeTidy tag hook |
40 | | - * |
41 | | - * @param Parser $parser |
42 | | - * @param string $text |
43 | | - * @return Boolean |
44 | | - */ |
45 | | - public static function parserBeforeTidy( Parser &$parser, &$text ) { |
46 | | - $out = $parser->getOutput(); |
47 | | - if ( isset( $out->articleEmblems ) ) { |
48 | | - $emblems = array(); |
49 | | - foreach ( $out->articleEmblems as $emblem ) { |
50 | | - $emblems[] = '<li class="articleEmblem">' . $emblem . '</li>'; |
51 | | - } |
52 | | - $text = '<ul id="articleEmblems">' . implode( $emblems ) . '</ul>' . $text; |
53 | | - } |
54 | | - return true; |
55 | | - } |
56 | | - |
57 | | - /** |
58 | 39 | * OutputPageParserOutput hook handler |
59 | 40 | * @param OutputPage $out |
60 | 41 | * @param ParserOutput $parserOutput |
— | — | @@ -62,6 +43,13 @@ |
63 | 44 | public static function outputPageParserOutput( OutputPage &$out, ParserOutput $parserOutput ) { |
64 | 45 | $out->addModuleStyles( 'ext.articleEmblems' ); |
65 | 46 | |
| 47 | + if ( isset( $parserOutput->articleEmblems ) ) { |
| 48 | + $emblems = array(); |
| 49 | + foreach ( $parserOutput->articleEmblems as $emblem ) { |
| 50 | + $emblems[] = '<li class="articleEmblem">' . $emblem . '</li>'; |
| 51 | + } |
| 52 | + $parserOutput->setText( '<ul id="articleEmblems">' . implode( $emblems ) . '</ul>' . $parserOutput->getText() ); |
| 53 | + } |
66 | 54 | return true; |
67 | 55 | } |
68 | 56 | } |
Index: trunk/extensions/ArticleEmblems/ArticleEmblems.php |
— | — | @@ -25,7 +25,6 @@ |
26 | 26 | |
27 | 27 | $wgHooks['ParserFirstCallInit'][] = 'ArticleEmblemsHooks::parserFirstCallInit'; |
28 | 28 | $wgHooks['OutputPageParserOutput'][] = 'ArticleEmblemsHooks::outputPageParserOutput'; |
29 | | -$wgHooks['ParserBeforeTidy'][] = 'ArticleEmblemsHooks::parserBeforeTidy'; |
30 | 29 | |
31 | 30 | $wgResourceModules['ext.articleEmblems'] = array( |
32 | 31 | 'styles' => 'ext.articleEmblems.css', |