Trying to integrate asciinema player

I'm trying to run asciinema player from silverbullet. This means loading a css, a js and having a dom element with an id. Currently I have

```space-style
@import url('https://cdn.jsdelivr.net/npm/[email protected]/dist/bundle/asciinema-player.css');
```

```space-lua
asciinemaplayer = js.import("https://cdn.jsdelivr.net/npm/[email protected]/+esm")

function getDemo()
return js.window.document.getElementById("demo")
end

```

and as raw html in my markdown:

<div id="demo">

Then I call
${asciinemaplayer.create("/.fs/testing.cast", getDemo())}
in silverbullet.

This works (sometimes) after restarting with alt+ctrl+r, but never on first load. Also, the ${..} gives back something like

Any ideas how to do this?

This feels like you're in "plug" land, something like the Mermaid plug might be a good example? GitHub - silverbulletmd/silverbullet-mermaid: Mermaid support for SilverBullet · GitHub

That way you could register asciinema as a document editor? And then transclude it in pages that you need it?

Maybe this is just not going to work... the player does some pretty hacky stuff like injecting an ifame.