-
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
Experimental: highlight.js for Anki and AnkiMobile #6
Comments
Default hljs.initHighlighting.called = false;
hljs.initHighlighting(); When opening cards in the Mac app, it takes a while to close down. Hopefully this won't impact performance of the app. |
Also refer to this issue for an alternative method suggested by the plugin's creator: var blocks = document.querySelectorAll('pre code:not(.hljs)');
Array.prototype.forEach.call(blocks, hljs.highlightBlock); Changed the above code also to reflect this edit |
Correct code snippet below, requires var blocks = document.querySelectorAll('pre code:not(.hljs)');
Array.prototype.forEach.call(blocks, hljs.highlightBlock); This seems to only affect the front card, not the reverse. Seems to work fine on iOS, works on browse mode on Mac OS (if a little buggy) but doesn't seem to work in drill mode on Mac OS. |
Ok so progress so far using unminified highlights shim, with script and calling script on only the front card: hljs.initHighlightingOnLoad();
var blocks = document.querySelectorAll('pre code:not(.hljs)');
Array.prototype.forEach.call(blocks, hljs.highlightBlock); hljs.initHighlighting.called = false;
hljs.initHighlighting();
|
Mac app console log, not particularly helpful
|
Closing this as #21 is infinitely easier to mantain. Too many bugs. |
Currently using highlight.js shim and copy and paste html via Marked App viewer (right-click, copy and paste in Anki html view). Also see Marked App html exporting):
To do:
The text was updated successfully, but these errors were encountered: