orsharir / github-mathjax

Chrome extension for rendering LaTeX equations in GitHub with MathJax
Other
153 stars 49 forks source link

Appears to only work on the root page of a repo #3

Closed adefazio closed 7 years ago

adefazio commented 7 years ago

For example, the equation on this very repo renders when viewing the root level, but if I actually click on README.md it's then not rendered on that page.

orsharir commented 7 years ago

It does work on all pages, however, github sometimes loads pages in a way that the extension fails to detect. As a temporary fix you can simply refresh the page.

adefazio commented 7 years ago

I see. I got it to render after refreshing a few times.

orsharir commented 7 years ago

I'm reopening this so I'll remember to fix this bug without the need to refresh this page.

Mottie commented 7 years ago

You can add this code to re-render the page after GitHub loads in a page dynamically:

document.addEventListener("pjax:end", function(){
    MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
});
orsharir commented 7 years ago

Thank you for your suggestion. I'm currently working on including it.