fred-wang / webextension-native-mathml

18 stars 3 forks source link

Native MathML doesn't work on the numpy and scipy documentation websites #16

Open ragdollfun opened 2 years ago

ragdollfun commented 2 years ago

Just as the title describes it, the Native MathML extension doesn't work on the numpy and scipy documentation websites.

To illustrate the issue, I've included two screenshots:

one where the extension is activated: Screenshot 2022-04-28 145511

and a second one where the extension is deactivated: Screenshot 2022-04-28 145549

My browser is Firefox version 99.0.1 (64-bit)

fred-wang commented 2 years ago

Thanks for the report. One would need to investigate a bit to understand what's happening, but note that Wikipedia and KaTeX websites insert the MathML source in the page so only need to reveal it via the CSS stylesheets at https://github.com/fred-wang/webextension-native-mathml/tree/master/content-scripts

For MathJax, things are more complex/fragile, there is one mathjax-menu-cookie.js script to force native mathml in cookies used by MathJax (at least until verson 2?) and and one mathjax-bug-fixes.js script that does more config (including disabling the mml2jax config when MathML is directly present on the page). Do you remember if extension worked on these websites in the past? It's possible that MathJax code has changed a lot and this stuff is no longer working with the latest versions...

I also wonder if you tried to play with the addon's preferences and checked if you get better result by disabling some options and restarting?

ragdollfun commented 2 years ago

Hello @fred-wang,

Thank you for your time.

Do you remember if extension worked on these websites in the past? It's possible that MathJax code has changed a lot and this stuff is no longer working with the latest versions...

I don't remember it not working when I visited the numpy or scipy websites in the past. However I might just not have noticed before.

I also wonder if you tried to play with the addon's preferences and checked if you get better result by disabling some options and restarting?

I've tried testing with different option combinations, but it doesn't seem to make any difference. The only way to see the equations rendered is to disable the extension.

tupui commented 2 years ago

@ragdollfun can you check against old versions of SciPy's documentation? See https://docs.scipy.org/doc/ for links

ragdollfun commented 2 years ago

Weird, it looks like MathJax doesn't immediately switch to images. There are a few seconds after I reload the page (with extension disabled) where MathJax itself renders to MathML (equations are selectable), but then it transforms everything into an image (with a different font and less sharp).

Extension enabled: Screenshot 2022-05-03 at 14-54-35 Signal Processing (scipy signal) — SciPy v1 0 0 Reference Guide

First few seconds after reload (sharper looking and selectable), extension disabled: Screenshot 2022-05-03 145538

Once MathJax has finished rendering images (blurrier and non-selectable), extension disabled: Screenshot 2022-05-03 150015