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


Steps to reproduce:

  1. Enable client-side MathJax in
  2. Enable "Vorschau sofort anzeigen" in
  3. Go to a non-existing article,
  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 added a subscriber: pajz.

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

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

TheDJ claimed this task.