Rendering math requires internet connection
Description: Math (between $ $) doesn't get rendered when offline.
To reproduce:
Start Apostrophe offline and enter some math, e.g. $\sqrt{2}$
.
Expected behavior:
Math is rendered normally in the preview pane, to \sqrt{2}
in this case.
Actual behavior: The text contains the TeX command(s) between \( \) (instead of $ $), not the rendered output.
You can find <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script>
in the <head>
of the generated HTML source when right-clicking the preview and selecting Inspect.
Obviously, this script can only be loaded with a working internet connection.
This line also appears if you have the mathjax
package installed (the script in question is at /usr/share/mathjax/tex-chtml-full.js
for me).
If you have trouble reproducing this issue when Apostrophe was online previously, your machine, Apostrophe, or Webkit may have cached the script (please don't ask me which one and where exactly, though).
Environment:
- Linux distribution: Endeavour OS (like Arch)
- Apostrophe version: 2.6.3-6 (AUR)
- Desktop Environment: GNOME
- DE version: gnome-shell 1:44.5-1
- GTK versions:
- gtk2 2.24.33-3
- gtk3 1:3.24.38-1
- gtk4 1:4.12.2-1
Suggested fix:
Check if MathJax (or KaTeX) is installed and use that as a script src
instead of an online source.