¡Oh! Entendí completamente mal cómo se generaría el HTML. Si el usuario está pregenerando el HTML, podrías hacer que lo incluyan desde un sitio externo, con el dominio en la lista blanca.
Por ejemplo, codepen, que debería permitirse por defecto:
<iframe height="300" width="800" style="width: 100%;" scrolling="no" title="mplD3 example, actually working" src="https://codepen.io/gully/embed/BawMGr?default-tab=result" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
See the Pen <a href="https://codepen.io/gully/pen/BawMGr">
mplD3 example, actually working</a> by gully (<a href="https://codepen.io/gully">@gully</a>)
on <a href="https://codepen.io">CodePen</a>.
</iframe>