Jwrede / Anki-KaTeX-Markdown

Creates a new Basic and a new Cloze Note Type that support Markdown and KaTeX
75 stars 5 forks source link

No rendered result is shown #1

Closed icearchimage closed 3 years ago

icearchimage commented 3 years ago

For the front side, it can render correctly if the content only contains markdown syntax. But if I add a math equation, it shows the content only once (It does not render even after restarting Anki). The backside shows only a horizontal line. When I switched to the backside and then switch back to the front preview again, the front side becomes blank too.

I installed the add-on "Ankiwebview Inspector" and this is the output of the console:

Uncaught (in promise) TypeError: Cannot read property 'ParseError' of undefined
    at l (auto-render.min.js:1)
    at e (auto-render.min.js:1)
    at t.default (auto-render.min.js:1)
    at renderMath (<anonymous>:38:3)
    at render (<anonymous>:28:3)
    at <anonymous>:8:37

Screenshot: anki_markdown.gif

Have you tried to test the add-on on a newly installed Anki? Maybe some other add-ons can affect the result. I tried in a virtual machine and the result is the same.

Versions: Windows 10 1607(VMware), Anki 2.1.42

Jwrede commented 3 years ago

Hey I really appreciate the effort you put into this issue, makes it alot easier to debug!

I think I fixed the bug now, you're right it's because of Anki 2.1.42, they must've changed the rendering process for cards, now it saves js variables on reload and my getScripts variable is declared everytime on render which javascript doesn't like.

Please let me know if this fixed your issue, I think you'll have to click on search for updates manually by clicking Tools -> Add-ons -> Check for Updates because Anki takes a day or two to do it manually.

Jwrede commented 3 years ago

Okay there's also another error with the auto-render plugin for KaTeX, give me another minute

Jwrede commented 3 years ago

Ok after much more time than I expected I think i fixed the error, on my PC it's working now, I'd appreciate it if you could give me feedback!

icearchimage commented 3 years ago

It works now! Really appreciate your work. Sorry for demanding a quick fix for such a new Anki version.

Jwrede commented 3 years ago

Perfect, I appreciate all issues here, in the moment I sadly don't have time to test the Add-on extensively so and Anki is a program with alot of edge cases!