Page MenuHomePhabricator

With MathJax and live preview enabled, math is displayed properly only the first time you click "preview" in a new article
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Enable client-side MathJax in https://de.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering
  2. Enable "Vorschau sofort anzeigen" in https://de.wikipedia.org/wiki/Spezial:Einstellungen#mw-prefsection-editing
  3. Go to a non-existing article, https://de.wikipedia.org/w/index.php?title=grlglkff&action=edit&redlink=1
  4. Enter a formula in <math> tags, e.g. <math>x=2</math>.
  5. Click "Preview". (Notice that the formula is rendered properly.)
  6. Click "Preview" once again. (Notice that the formula is displayed as "$ x=2 $".)

Event Timeline

pajz raised the priority of this task from to Needs Triage.
pajz updated the task description. (Show Details)
pajz added a project: Math.
pajz subscribed.

by the way it works in MathML mode though
With MathML mode im referring to "MathML mit SVG- oder PNG-Rückgriff (empfohlen für moderne Browser und Barrierefreiheitswerkzeuge)" which sound much more complicated that it actually is.

It works the first time, and it works the second time when i force it to be 'late'.

Probably means that just as TMH, it doesn't really like to do rendering when the content is not yet attached to a parent. I think i'm going to change that in the livePreview module, or add an additional 'late' hook. because it's causing too much trouble...

Change 193270 had a related patch set uploaded (by TheDJ):
LivePreview: Use setTimeout to delay rendering of MathJax

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

Change 193270 merged by jenkins-bot:
LivePreview: Use setTimeout to delay rendering of MathJax

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

TheDJ claimed this task.