252
edits
Changes
Use $content as #wikiPreview is not available when hook is fired.
// MathJax typesetting in edit previews
function mathJaxTypeset($content) {
function waitForMathJax() {
if (typeof MathJax === 'undefined') {
console.log('Waiting for MathJax.');
} else {
MathJax.Hub.Queue(["Typeset", MathJax.Hub, "wikiPreview"$content]).execute();
alert('Found MathJax; typeset done.');
}