Page MenuHomePhabricator

MathML: Using en dash as minus takes a parser error
Closed, InvalidPublic

Description

Author: Juergen.Thomas

Description:
screenshot showing the parser error

If a formula uses a hyphen as minus char, it is shown correctly. Replacing the hyphen by en-dash – U+2013 by Alt-0-1-5-0 – will take a parser error in some situations. Note: German typographical rules demand en-dash as minus char; a user should be able to write it within formulas in each case.

Example: screenshot (attachment) and de-Wikibooks:
https://de.wikibooks.org/w/index.php?title=Wikibooks:Spielwiese&oldid=722798

Environment: de-Wikibooks - user preferences: rendering with MathML and SVG/PNG - Windows 7 Home Premium SP1 with Firefox 33.1


Version: unspecified
Severity: normal
OS: Windows 7
Platform: PC

Attached:

Parser_Error_Dash.JPG (246×607 px, 35 KB)

Details

Reference
bz73367

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:54 AM
bzimport set Reference to bz73367.
bzimport added a subscriber: Unknown Object (MLST).

physik wrote:

I don't understand your poblem. In $\TeX$ you are supposed to use a normal - (https://en.wikipedia.org/wiki/Plus_and_minus_signs#Minus_sign) char. If that produces wrong rendering that must be fixed in display part and not in the input / parser part. So the input in the math tag is what you mean and not what you expect to see.

To add to physikerwelt.

The rendering issue probably stems from the old TeX backend that does not support Unicode well.

Do you have any rendering issues in the new MathML/SVG option?

From a MathML point of view, the minus sign should be encoded as U+2212 (which mathoid would generate from a regular -, whereas en dash would be kept as U+2013 which is not ideal, e.g., for accessibility).

Juergen.Thomas wrote:

Danke, Peter, für diese Ergänzung. Tatsächlich wäre U+2212 das korrekte Zeichen und sollte von TeX korrekt verarbeitet werden. (Ich hatte primär U+2013 verwendet, weil es mit Alt-0-1-5-0 und in den deutschen Standard-Sonderzeichen bei den WMF-Projekten steht; aber da kann ich mich natürlich umgewöhnen.)

Sorry for writing in German: At the moment, the discussion isn't official, and each contributor seems to be a German.

Not sure how+who to make some discussion "official" though and what means. :)

Juergen.Thomas wrote:

IMHO that means: The bug is marked as "invalid". If someone else confirms the problem and sets the status to "reopened", the discussion is "official" again. Juergen

Well, it seems sensible to support this. It's just doing a replacement of similar minus glyphs inside <math>. A task for google code-in? :)

(In reply to Platonides from comment #6)

A task for google code-in? :)

If there's a mentor available, please be my guest: https://www.mediawiki.org/wiki/Google_Code-in_2014#Mentors.27_corner :)