How to replace/overwrite default renderers like (RenderedHTMLCommon, RenderedJavaScript)

Hi,

I would like to change the way that Javascript and HTML is rendered. Is there a way to inject my own renderers for this? From checking the code it seems like I would need to go up to the level of Content Factories to plugin, which would mean a lot of custom code for a very narrow change. But I am not sure if I might have not completely understood the plugin capabilities in this area, therefore I thought it would be ok to ask for help in this forum.

Maybe some background on what I try to achieve. In our hosted installation, users love Notebooks. They use it to interactively train models that are then deployed. So the focus is on the changes to external entities, not using notebooks for advanced reporting. Therefore the output is pretty basic and does not need embedded script.

At the same time the security team wants to remove any potential risk (and get the reports green) and enforce that no JavaScript can executed. (In the end, they would like to keep all cells in an untrusted mode)

I know there were debates about this kind of use case and common sense is that Notebook Users should be in full control. And I generally agree. But having means to customize this for special setups without replacing a whole factory would help a lot.

Update: I meanwhile found out that I can provide my own MimeRenderer Extensions for text/html and application/javascript that take precedence over the default renderers.

Any known pitfalls with this approach?