ae18ba2a05
Re: https://forums.ankiweb.net/t/anki-2-1-53-release-candidate/20122/2 Autoloads in MathJax are asynchronous, and the caller is expected to use asynchronous APIs when they are in use [1]. The editor uses the synchronous tex2svg(), which throws a "MathJax retry" error when an autoload package has not yet loaded. Attempting to use the package before it has loaded appears to break future invocations as well, so the package fails to work at all until a new webview is created. The following HTML will reproduce the issue when added to a single card in a new profile: ``` <strong>6 </strong>Every combination of <anki-mathjax>\boldsymbol{v}=(1,-2,1)</anki-mathjax> and <anki-mathjax>\boldsymbol{w}=(0,1,-1)</anki-mathjax> has components that add to _____.<br> ``` Ideally we'd switch the MathJax rendering to be asynchronous, but that didn't work well when I tried it in #1862. For now I've just switched to the full package, which adds about 130KB to the final minified JS (2.76MB), and likely slows down editor loading somewhat. [1] https://github.com/mathjax/MathJax/issues/2557#issuecomment-727655089 |
||
---|---|---|
.. | ||
BUILD.bazel | ||
content-editable.ts | ||
ContentEditable.svelte | ||
decorated.ts | ||
editable-base.scss | ||
frame-element.ts | ||
frame-handle.ts | ||
icons.ts | ||
index.ts | ||
mathjax-element.ts | ||
Mathjax.svelte | ||
mathjax.ts | ||
ResizableImage.svelte | ||
tsconfig.json |