decorateCooked in theme vs HighlighJS

I just had the same challenge, so I added a new API feature to handle this use case: api.registerHighlightJSPlugin.

You can pass highlightjs function based plugins to it, which is documented at Plugin API — highlight.js 11.9.0 documentation