From 97d6f8ff899feb007c4d8fa643cbb30c0e0df221 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Wed, 15 Oct 2014 06:08:41 -0700 Subject: [PATCH] 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 --- MathMathML.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MathMathML.php b/MathMathML.php index d5c2cf0..32e56cc 100644 --- a/MathMathML.php +++ b/MathMathML.php @@ -383,8 +383,9 @@ class MathMathML extends MathRenderer { $this->correctSvgStyle( $this->getSvg(), $style ); if ( $class ) { $attribs['class'] = $class; } if ( $style ) { $attribs['style'] = $style; } - // an alternative for svg might be an object with type="image/svg+xml" - return Xml::element( 'span', $this->getAttributes( 'span', $attribs , array( 'aria-hidden' => 'true' ) ) ); + // Don't use an empty span, as that is going to be stripped by HTML tidy + // when enabled (which is true in production). + return Xml::element( 'meta', $this->getAttributes( 'span', $attribs , array( 'aria-hidden' => 'true' ) ) ); }