GWicke has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/166738

Change subject: Work around tidy by using a meta element instead of an empty 
span
......................................................................

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
---
M MathMathML.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/38/166738/1

diff --git a/MathMathML.php b/MathMathML.php
index d5c2cf0..32e56cc 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -383,8 +383,9 @@
                $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' ) ) );
        }
 
 

-- 
To view, visit https://gerrit.wikimedia.org/r/166738
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bcbbc9468433e3c8722c09ce813a6f5ac741333
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: GWicke <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to