-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How Did You Solve iOS Highlight.js? #19
Comments
🆘 |
@adeluccar Hi Alberto, I've been testing the Highlight.js script for a while now and honestly, I don't think Anki handles javascript well at all. I'm a complete novice with js, so perhaps someone else has a better method of handling Highlight.js (I've been looking for lighter examples, or different libraries, but no success yet) ... The current method I'm using is the shim repository via Bower, with the following code: var blocks = document.querySelectorAll('pre code:not(.hljs)');
Array.prototype.forEach.call(blocks, hljs.highlightBlock); This works well on iOS, and partially in OSX (on the front card, but not on the reverse). The caveats are:
So, until Anki fully supports I've been using Power format pack quite a bit, which really speeds up card creation. So I'll open another issue and see what people think. |
Hey @badlydrawnrob,
I have the following code in a template (Front Side):
Do you know why this works in Anki OS X and not in IOS?
How did you fix it?
Would really appreciate if you could help me out.
I downloaded your deck but couldn't figure it out myself.
Thanks! :
—Alberto
The text was updated successfully, but these errors were encountered: