Set spellcheck attribute with Highlighter

In CM6, it doesn’t seem possible to set any DOM element attributes (more specifically the spellcheck attribute) using @codemirror/highlight, since the TagStyle only support class or styles/StyleModule.

Is there any way to set attributes with highlight that I missed?
Is there some correct work-around? Maybe through some additional ViewPlugin or decoration?
If nothing else, is there any hacky way to solve it?

The browser(s) supports having spellcheck="true" on spans within the content, and only perform spellcheck on them, which is good. There should be multiple usecases for this, especially for markup languages and similar.

Thanks again!

Mark decorations, possibly created based on the syntax tree, should be able to do what you want here.

Thanks for the response! I’ll try that.