GithubHelp home page GithubHelp logo

Comments (4)

glutanimate avatar glutanimate commented on August 15, 2024

Hi Vincent,
Thanks for the report. The issue could either be due to the way LaTeX is handled by Anki's templating engine, or caused by the JavaScript code used to remove the cloze markers in the original hint.

As this issue likely only facts a very small portion of the add-on's userbase, I don't have time to investigate it right now. However, if you get the chance yourself you could try messing around with the following lines in your OC card templates and see if you can get things to work properly:

var hint = document.querySelector('.fullhint>[id^="hint"]')
var html = hint.innerHTML.replace(/\[\[oc(\d+)::(.*?)(::(.*?))?\]\]/mg, "$2")

(If this is crucial to your workflow and you don't have time to look into it yourself I would also be happy to work on it against a small fee. In that case feel free to send me an email at ankiglutanimate[Îąt]gmail.com).

from cloze-overlapper.

VincentPf avatar VincentPf commented on August 15, 2024

Thank you for your reply.

I think the problem is that the LaTeX part generates an image and then the JavaScript code tries to remove the cloze markers from that image (which obviously won't work).
In order for it to work properly, the cloze markers would have to be removed before the image of the LaTeX part is generated. Therefore, I don't think that changing the lines in the card templates will help.

from cloze-overlapper.

glutanimate avatar glutanimate commented on August 15, 2024

Right, that's definitely it. With all of the recent porting efforts I was thinking in "Anki 2.1 mode" where MathJax is the preferable way to render LaTex.

In that case I'm afraid there isn't much I can do. It's possible to modify the card renderer and apply changes to the source text before it's passed on to the LaTeX compiler, I did so for Sequence Inserter. However, modifying the card rendering code is a very ugly affair and not portable across other platforms.

So perhaps the best way to handle this would be to set it aside until the add-on is 2.1 compatible and then look into making the hints work with MathJax.

from cloze-overlapper.

VincentPf avatar VincentPf commented on August 15, 2024

So perhaps the best way to handle this would be to set it aside until the add-in is 2.1 compatible and then look into making the hints work with MathJax.

Sounds good.

from cloze-overlapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.