mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-11 16:58:38 +00:00
Use spans for displaystyle fallback images
Previously, we were using div containers to SVG fallback images to mimic the MathML behaviour. This had unintended side effects as reported in T182041. This change uses span containers for both display and inline math fallback images. Bug: T182041 Change-Id: I1d563f9f3cba8a10af2665518be6c672de174333
This commit is contained in:
parent
008db7ad08
commit
b86ab8b4fa
|
@ -457,10 +457,8 @@ class MathMathML extends MathRenderer {
|
|||
$config = MediaWikiServices::getInstance()->getMainConfig();
|
||||
$enableLinks = $config->get( "MathEnableFormulaLinks" );
|
||||
if ( $this->getMathStyle() === 'display' ) {
|
||||
$element = 'div';
|
||||
$mml_class = 'mwe-math-mathml-display';
|
||||
} else {
|
||||
$element = 'span';
|
||||
$mml_class = 'mwe-math-mathml-inline';
|
||||
}
|
||||
$attribs = [ 'class' => 'mwe-math-element' ];
|
||||
|
@ -494,7 +492,7 @@ class MathMathML extends MathRenderer {
|
|||
'class' => $mml_class,
|
||||
];
|
||||
}
|
||||
$output .= Html::rawElement( $element, $mml_attribs, $mml );
|
||||
$output .= Html::rawElement( 'span', $mml_attribs, $mml );
|
||||
if ( $svg ) {
|
||||
$output .= $this->getFallbackImage();
|
||||
}
|
||||
|
@ -506,7 +504,7 @@ class MathMathML extends MathRenderer {
|
|||
);
|
||||
}
|
||||
|
||||
return Html::rawElement( $element, $attribs, $output );
|
||||
return Html::rawElement( 'span', $attribs, $output );
|
||||
}
|
||||
|
||||
protected function dbOutArray() {
|
||||
|
|
Loading…
Reference in a new issue