From d6034c6dcf28ab3c9f2e12fd6ecc53815ddd66e8 Mon Sep 17 00:00:00 2001 From: gugutu <59798823+gugutu@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:19:38 +0800 Subject: [PATCH] Fix for Anki version 24.04+ --- src/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/__init__.py b/src/__init__.py index d8878e6..c743fb4 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -26,7 +26,13 @@ class EditorPreview(object): buildversion = buildinfo.version.split(".") # Anki changed their versioning scheme in 2023 to year.month(.patch), causing things to explode here. - if not int(buildversion[0]) >= 23 and int(buildversion[2]) < 45: # < 2.1.45 + if int(buildversion[0]) >= 24: + self.js = [ + "js/mathjax.js", + "js/vendor/mathjax/tex-chtml-full.js", + "js/reviewer.js", + ] + if not int(buildversion[0]) == 23 and int(buildversion[2]) < 45: # < 2.1.45 self.js = [ "js/vendor/jquery.min.js", "js/vendor/css_browser_selector.min.js",