Shared decks having JavaScript in collections.media

I read in the Anki manual that for Static Sounds/Images if you name an image something like “_logo.jpg” and reference it in a template like

<img src="_logo.jpg">

that it will be exported when sharing a deck.

Questions:

  1. What is the logic for how this works? Does Anki search the template first for all tags having a src attribute and include the file when exporting if the file name in the src attribute starts with an underscore? Or does it look at all attributes?

  2. Should this be expected to work for JavaScript files referenced from script tags as well? For example, if I have a file _some_script_1.0.js in collections.media and the script tag below will the script be included when sharing a deck?

<script src="_some_script_1.0.js">

Well, this is something you could easily test to confirm :slight_smile: But if I recall correctly, if the filename is found in the template, it gets included.

Yea I plan to test it but I also wanted to check if this was something I should expect to work. I wouldn’t want to follow this approach and have it stop working in the future because it isn’t supported. Thanks!