Page MenuHomePhabricator

MathJax don't render correctly in TOC
Closed, DeclinedPublic

Description

Aspect in FireFox

If the <math> tag is used in a heading, the rendering on Table of Content is wrong.
See screenshot in Firefox and IE (is not the same result) of the article [[:w:it:Velocità della luce]].


Version: unspecified
Severity: major

Attached:

FireFox.JPG (88×521 px, 17 KB)

Details

Reference
bz38641

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:58 AM
bzimport added a project: Math.
bzimport set Reference to bz38641.

Created attachment 10881
Aspect in InternetExplorer

Attached:

IE.JPG (83×517 px, 17 KB)

This is what has been output:

<h2> <span class="mw-headline" id=".24_c_0_.5C.2C.5C.21_.24_velocit.C3.A0_superabile.3F"><span class="tex" dir="ltr">$ c_0 \,\! $</span> velocità superabile?</span></h2>

<li class="toclevel-1 tocsection-3"><a href="#.24_c_0_.5C.2C.5C.21_.24_velocit.C3.A0_superabile.3F"><span class="tocnumber">3</span> <span class="toctext">$ c_0 \,\! $ velocità superabile?</span></a>

Nageh's wiki2jax.js preprocessor only calls "ConvertMath" on span and img tags with "tex" class. So the TeX in the <li> of comment 2 won't be parsed. This could be fixed by either modifying Preprocess in wiki2jax.js or generating the correct span.tex and img.tex elements in the TOC. Or fixing bug 35479 and just removing the wiki2jax preprocessor.

physik wrote:

I see the problem
https://it.wikipedia.org/wiki/Utente:Physikerwelt
<span class="tocnumber">2.2</span> <span class="toctext"><span>$ c_0 $</span></span></a>

This seems like a bug in the ToC sanitizer or in the Tidy library.

physik wrote:

https://www.mediawiki.org/wiki/Extension:Math/bug/38641
seem to be still a problem. should be fixed in the next release

physik wrote:

rendering in mathml mode

Attached:

38641.png (1×960 px, 172 KB)

Physikerwelt claimed this task.
Physikerwelt subscribed.

MathJax will be removed T99369