Work around tidy by using a meta element instead of an empty span
HTML tidy will strip empty spans, so don't use one for the fallback image. We use a meta element instead, as that does not normally render at all & doesn't have any default styling coming with it. Change-Id: I5bcbbc9468433e3c8722c09ce813a6f5ac741333
This commit is contained in:
parent
672df7dcc8
commit
97d6f8ff89
@ -383,8 +383,9 @@ class MathMathML extends MathRenderer {
|
|||||||
$this->correctSvgStyle( $this->getSvg(), $style );
|
$this->correctSvgStyle( $this->getSvg(), $style );
|
||||||
if ( $class ) { $attribs['class'] = $class; }
|
if ( $class ) { $attribs['class'] = $class; }
|
||||||
if ( $style ) { $attribs['style'] = $style; }
|
if ( $style ) { $attribs['style'] = $style; }
|
||||||
// an alternative for svg might be an object with type="image/svg+xml"
|
// Don't use an empty span, as that is going to be stripped by HTML tidy
|
||||||
return Xml::element( 'span', $this->getAttributes( 'span', $attribs , array( 'aria-hidden' => 'true' ) ) );
|
// when enabled (which is true in production).
|
||||||
|
return Xml::element( 'meta', $this->getAttributes( 'span', $attribs , array( 'aria-hidden' => 'true' ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user