Page MenuHomePhabricator

MathJax doesn't work in LivePreview
Closed, ResolvedPublic


Raw TeX commands are displayed.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:21 AM
bzimport added a project: Math.
bzimport set Reference to bz36060.
bzimport added a subscriber: Unknown Object (MLST).

More or less the same as in bug 33399. If JavaScript features in LivePreview don't work for core features one can't expect it to work for extensions.
A hook system as suggested in bug 23580 would be the best way to fix this bug.
See also bug 35478.

  • This bug has been marked as a duplicate of bug 33399 ***
  • This bug has been marked as a duplicate of bug 24134 ***

Re-opening as this needs two things:

  • Be able to get modules loaded that extensions add to the page (bug 24134)
  • Be able to run code for "article loaded" when the article html is loaded. Usually this is document-ready which is how we do it now, but in case of preview we have multiple "article loaded" points within the lifecycle of a single page. This will be made possible by 30713.

MathJax module now has a $().renderTex command that can be run to render domelements that contain tex commands. A preview hook can use this to postprocess the preview output.

(For the record, there is now a fix in progress for bug 30713 which is a dependency here.)

Both Ajaxpreview and wikEd now use the renderTex() command to render MathJax in their ajax based preview modes:


Soon to be improved by making use of

A specific problem is that after a session in VisualEditor a full refresh is not done and MathJax is not rerun, so the raw latex code is displayed. Apparently according to bug 51565 gadgets should listen to "wikipage.content". I have heard rumours that the fix to bug 48560 will fix this problem.

This ha come up at

Change 124064 had a related patch set uploaded by TheDJ:
MathJax: Listen for wikipage.content hook

Change 124064 merged by jenkins-bot:
MathJax: Listen for wikipage.content hook

Patch was merged a while ago - is there more work left to do here (if yes: please reset the bug report status to NEW or ASSIGNED), or can you close this ticket as RESOLVED FIXED?

I just tested and it still doesn't seem to work (PNG images are shown).

For LivePreview, it depends on bug 24134 which isn't fixed yet, because I still need to finish The patch that was merged was just one of the prerequisites.

VE is a separate issue.

TheDJ claimed this task.

I see i forgot to close this one. This is basically working now, though there apparently is a bug, reported in T90808.