Codemirror 6: Composing highlighters

My team uses JavaScript tagged template literals with HTML and CSS embedded in them. I believe v5 supports this. how would we go about enabling this for v6 and Lezer grammars? The embedded languages are denoted with either html or css tags:

render() {
  return html`<div class="a">Hello</div>`

I’m not aware of support for this in v5.

There is some support for nested grammars in Lezer (see the HTML mode, which switches to JS or CSS in the appropriate tags), but for an ad-hoc thing like this (you’ll still have ${} escapes in the string, so it’s not strictly HTML), I’m not sure how easy this would be to set up. In any case, it requires support from the parent grammar (which would be the JavaScript grammar in this case, which you’d probably have to fork).

I found the v5 implementation. It’s in the google-modes package: which does appear to have its own forks of the supported languages.