I use codemirror for a REPL-style app, where a user can type code and see the results of running it in the same document. I’d like to apply a mode (e.g. syntax highlighting) to user’s code, but not to the code’s output. Since output can be literally anything, this cannot be done based purely on the contents. However, when I insert text into the document, I know whether it comes from the user or from the code.
Is there a way to select or bypass mode based on that? E.g. by passing options into replaceRange or creating markers?
Thanks in advance,