diff --git a/src/MermaidParserFunction.php b/src/MermaidParserFunction.php index 291e8bd..0d179ef 100644 --- a/src/MermaidParserFunction.php +++ b/src/MermaidParserFunction.php @@ -3,7 +3,6 @@ namespace Mermaid; use Parser; -use Html; use MediaWiki\MediaWikiServices; /** @@ -81,7 +80,13 @@ public function parse( array $params ) { $content = implode( "|", $mwParams ); $graphConfig = array_merge( $graphConfig, $mermaidConfig ); - return Html::rawElement( + if ( class_exists( 'MediaWiki\\Html\\Html' ) ) { + // MW 1.40+ + $htmlClass = \MediaWiki\Html\Html::class; + } else { + $htmlClass = \Html::class; + } + return $htmlClass::rawElement( 'div', [ 'class' => $class, @@ -92,7 +97,7 @@ public function parse( array $params ) { ] ) ], - Html::rawElement( + $htmlClass::rawElement( 'div', [ 'class' => 'mermaid-dots',