Skip to content

Commit 647441e

Browse files
committed
Add import for namespaced Html class
Raise MW requirement accordingly.
1 parent 479dbc7 commit 647441e

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"license-name": "GPLv3",
1010
"type": "parserhook",
1111
"requires": {
12-
"MediaWiki": ">=1.35.0"
12+
"MediaWiki": ">=1.40.0"
1313
},
1414
"AutoloadClasses": {
1515
"EmbedSnap": "includes/EmbedSnap.php"

includes/EmbedSnap.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818
*/
1919

2020
use MediaWiki\Hook\ParserFirstCallInitHook;
21+
use MediaWiki\Html\Html;
2122

2223
if ( !defined( 'MEDIAWIKI' ) ) {
2324
die( 'Snap! Project Embed requires MediaWiki 1.35 or later to run.' );
2425
}
2526

2627
class EmbedSnap implements ParserFirstCallInitHook {
27-
/** Register <snap> and <snap-project> tags */
28+
/** Register <snap> and <snap-project> tags */
2829
public function onParserFirstCallInit( $parser ) {
2930
$parser->setHook( 'snap', [ __CLASS__,'renderEmbedSnap' ] );
3031
$parser->setHook( 'snap-project', [ __CLASS__,'renderEmbedSnap' ] );
@@ -41,9 +42,9 @@ public static function renderEmbedSnap( $input, $argv, $parser ) {
4142
$pause = '';
4243
$hide = '';
4344
$elementtorender = '';
44-
45+
4546
// Arguments passed to the parser
46-
if ( !empty( $argv['project'] ) ) {
47+
if ( !empty( $argv['project'] ) ) {
4748
$project = $argv['project'];
4849
} elseif ( !empty( $input ) ) {
4950
$project = $input;
@@ -122,7 +123,7 @@ public static function renderEmbedSnap( $input, $argv, $parser ) {
122123
}
123124
if ( !empty( $project ) ) {
124125
if ( !empty( $user ) ) {
125-
return (
126+
return (
126127
// If both user and project values are given, it renders the proper iframe.
127128
$elementtorender
128129
);

0 commit comments

Comments
 (0)