Linking to external javascript

I previously posted on a thread on r/Anki how to load external libraries dynamically with a loader using Promise API. This method still works for me on Anki 2.1.29/30beta. For example, in my card template, I load clipboard.js, Marked.js, and Prism with the loader, and then syntax-highlight code block in markdown-formatted string. See this screenshot:

4 Likes