I use c++ preprocessor and .Net Mono T4 templating tool to combine several diagrams into one html document. I do it in VSCode.
With this this suggested ability it would be possible to call external scripts (from main html page) and do local html anchor links.
Example:
[[#SVG_EMBED onclick='currentDiv(1)' onhover='some_cool_effect(777)' #SVGEMBED {haha} LINK]]