What is a best way to highlight raw HTTP request and responses using codemirror6

I was playing around with codemirror6 and figured out how to highlight the syntax of js, HTML, HTTP etc, individually.

What would be the best way to showcase HTTP raw request/responses in codemirror6? I am reading on Mixed-Language Parsing. Is that the way to go?

I guess you’d want to look at the content-type header and base the highlighting of the body on that? If you have a Lezer parser for HTTP, it should be possible for a mixed-language parser to look at the tree to find that header, and assign the appropriate parser to the body. However, @codemirror/language-data doesn’t associate mime types with languages, so you’d have to define that mapping yourself.