Page MenuHomePhabricator

MathML + SVG fallback - Missing semicolon in SVG fallback image HTML code
Closed, DuplicatePublic

Description

I believe there is a bug in the way the SVG fallback image HTML code is generated when using MathML + SVG fallback and a Mathoid server.
Here is the HTML code that I obtain for an SVG fallback image:

<meta class="mwe-math-fallback-image-inline" aria-hidden="true" style="background-image: url(&#39;/wiki/index.php?title=Special:MathShowImage&amp;hash=2caf40baf06d5cb633d350e651164506&amp;mode=mathml&#39;); background-repeat: no-repeat; background-size: 100% 100%; vertical-align:-2.338exheight: 6.176ex; width: 24.761ex;" />

There is a missing semicolon between vertical-align:-2.338ex and height: 6.176ex, and that causes the SVG image not to display on the page.
The problem appears to come from the function correctSvgStyle( &$style ) in MathMathML.php.

I could fix the bug by changing the line

$style .= ' ' . $styles[1]; // merge styles

into

$style .= ' ' . $styles[1] . ';'; // merge styles

Event Timeline

Hi,

thank you for sharing your fix.
Which version of the Math extension are you using.
I think a similar problem was fixed in T132563.

Hi,

Sorry for the duplicate bug report. I had done a quick search and couldn't find the issue... I should have been more thorough.

The version of the Math extension that I use what downloaded from https://www.mediawiki.org/wiki/Special:ExtensionDistributor/Math for Wikimedia 1.26 (REL 1_26), which doesn't include the fix.