Last modified: 2014-10-19 19:57:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T51210, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 49210 - MathJax error when using backslash as spacing "\ " in front of semicolon, colon or exclamation mark (";", ":", "!")
MathJax error when using backslash as spacing "\ " in front of semicolon, col...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
master
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 61091
  Show dependency treegraph
 
Reported: 2013-06-05 20:45 UTC by Eduard Braun
Modified: 2014-10-19 19:57 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Eduard Braun 2013-06-05 20:45:57 UTC
I noticed a bug in MediaWiki's MathJax implementation:

When using "\ " to produce some spacing at the end of a formula this only works in front of e.g. dots or commas, but not in front of colons, semicolons or exclamation marks (those were the cases I tested)

Examples (working):
<math>x\ .</math>
<math>x\ ,</math>

Examples (NOT working):
<math>x\ :</math>
<math>x\ ;</math>
<math>x\ !</math>

I tested these TeX commands in LaTeX as well as the online demo of MathJax and it works in both of them, so it seems to be a problem in MediaWiki's implementation of MathJax (or only solved recently in MathJax itself, so the fix didn't make it yet into MediaWiki's code, English Wikipedia is using version 1.22wmf5 (43f93b2) at the time of this writing).
Comment 1 Eduard Braun 2013-06-05 20:47:07 UTC
Maybe I should mention that a red backslash is shown in the not working cases instead of producing whitespace.
Comment 2 Frédéric Wang 2013-09-10 13:57:48 UTC
So the "working" cases seem to produce a space while the "non-working" cases produces a no-break space &#160;. That can be fixed easily by adding a .replace(/\u00A0/g," ") in ConvertMath of wiki2jax, or making the PHP output a space or by fixing bug 35479 and removing the wiki2jax processor.

See also upstream issue https://github.com/mathjax/MathJax/issues/377
Comment 3 physikerwelt 2014-02-09 02:02:05 UTC
It still causes problems see
https://de.wikipedia.org/wiki/Benutzer:Physikerwelt#BUG_49210
Comment 4 Peter Krautzberger 2014-02-10 13:56:26 UTC
@physikerwelt have you tried what Fred Wang suggested above? (Or do you need a volunteer to code it so that you can land it?)

This is a bad interaction between the math extension (or perhaps MediaWiki more generally, I don't know) and MathJax "bug" 377. 

MediaWiki converts <math>x\ :</math> to <math>x\&nbsp; :</math>. While MathJax tolerates &nbsp; in TeX source code, it interprets "\&nbsp;" a TeX command -- invisible hilarity ensues...

You could argue that if MathJax considers &nbsp; a space, then it should tolerate \&nbsp; as well. I'll raise this on our issue tracker (I've reopened the bug).

Peter.
Comment 5 Peter Krautzberger 2014-02-19 15:44:49 UTC
There will be a fix for this in the next MathJax version, see https://github.com/mathjax/MathJax/issues/377
Comment 6 physikerwelt 2014-02-19 16:32:07 UTC
I'll provide a guide how to cherry pick patches from MathJax to Wikipedia.
Comment 7 physikerwelt 2014-10-19 19:46:23 UTC
Renderes fine in MathML mode
see
https://www.mediawiki.org/wiki/Extension:Math/bug/49210
Comment 8 Eduard Braun 2014-10-19 19:57:31 UTC
Well, it was basically a MathJax bug, but that seems fixed, too (so the bug is really resolved).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links