Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php |
— | — | @@ -49,7 +49,6 @@ |
50 | 50 | ); |
51 | 51 | |
52 | 52 | $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = dirname( __FILE__ ) . '/SyntaxHighlight_GeSHi.class.php'; |
53 | | -$wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook'; |
54 | 53 | $wgExtensionFunctions[] = 'efSyntaxHighlight_GeSHiSetup'; |
55 | 54 | |
56 | 55 | /** |
— | — | @@ -58,4 +57,4 @@ |
59 | 58 | function efSyntaxHighlight_GeSHiSetup() { |
60 | 59 | global $wgParser; |
61 | 60 | $wgParser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) ); |
62 | | -} |
\ No newline at end of file |
| 61 | +} |
Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php |
— | — | @@ -69,34 +69,6 @@ |
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
73 | | - * Hook into Article::view() to provide syntax highlighting for |
74 | | - * custom CSS and JavaScript pages |
75 | | - * |
76 | | - * @param string $text |
77 | | - * @param Title $title |
78 | | - * @param OutputPage $output |
79 | | - * @return bool |
80 | | - */ |
81 | | - public static function viewHook( $text, $title, $output ) { |
82 | | - // Determine the language |
83 | | - preg_match( '!\.(css|js)$!u', $title->getText(), $matches ); |
84 | | - $lang = $matches[1] == 'css' ? 'css' : 'javascript'; |
85 | | - // Attempt to format |
86 | | - $geshi = self::prepare( $text, $lang ); |
87 | | - if( $geshi instanceof GeSHi ) { |
88 | | - $out = $geshi->parse_code(); |
89 | | - if( !$geshi->error() ) { |
90 | | - // Done |
91 | | - $output->addHeadItem( "source-$lang", self::buildHeadItem( $geshi ) ); |
92 | | - $output->addHtml( "<div dir=\"ltr\">{$out}</div>" ); |
93 | | - return false; |
94 | | - } |
95 | | - } |
96 | | - // Bottle out |
97 | | - return true; |
98 | | - } |
99 | | - |
100 | | - /** |
101 | 73 | * Initialise a GeSHi object to format some code, performing |
102 | 74 | * common setup for all our uses of it |
103 | 75 | * |
— | — | @@ -205,4 +177,4 @@ |
206 | 178 | } |
207 | 179 | } |
208 | 180 | |
209 | | -} |
\ No newline at end of file |
| 181 | +} |