diff --git a/qt/aqt/data/web/js/mathjax.js b/qt/aqt/data/web/js/mathjax.js index 2074174f3..c863939c1 100644 --- a/qt/aqt/data/web/js/mathjax.js +++ b/qt/aqt/data/web/js/mathjax.js @@ -1,28 +1,27 @@ window.MathJax = { - tex: { - displayMath: [["\\[", "\\]"]], - processRefs: false, - processEnvironments: false, - packages: { - "[+]": ["noerrors", "mhchem"], - }, + tex: { + displayMath: [["\\[", "\\]"]], + processRefs: false, + processEnvironments: false, + packages: { + "[+]": ["noerrors", "mhchem"], }, - startup: { - typeset: false, - pageReady: () => { - console.log("page is ready"); - return MathJax.startup.defaultPageReady(); - }, + }, + startup: { + typeset: false, + pageReady: () => { + return MathJax.startup.defaultPageReady(); }, - options: { - renderActions: { - addMenu: [], - checkLoading: [], - }, - ignoreHtmlClass: "tex2jax_ignore", - processHtmlClass: "tex2jax_process", - }, - loader: { - load: ["[tex]/noerrors", "[tex]/mhchem"], + }, + options: { + renderActions: { + addMenu: [], + checkLoading: [], }, + ignoreHtmlClass: "tex2jax_ignore", + processHtmlClass: "tex2jax_process", + }, + loader: { + load: ["[tex]/noerrors", "[tex]/mhchem"], + }, }; diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index c4d15f319..1982bc2d4 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -90,6 +90,9 @@ class AnkiWebPage(QWebEnginePage): buf = "JS %(t)s %(f)s:%(a)d %(b)s" % dict( t=level, a=line, f=srcID, b=msg + "\n" ) + if "MathJax localStorage" in buf: + # silence localStorage noise + return # ensure we don't try to write characters the terminal can't handle buf = buf.encode(sys.stdout.encoding, "backslashreplace").decode( sys.stdout.encoding