I would like to use CodeMirror’s markdown language as the main language of the editor, but implement parseMixed with TeXlyre’s LaTeX language, which has its own existing grammar. The goal (and assumption) is that LaTeX will pick up math in dollar signs and any LaTeX commands and environments with backslashes, and Markdown will cover the rest.
I have no idea how to use parseMixed to make this happen, though. Any suggestions?
If you’re talking about making the LaTeX mode pick up stuff that looks like LaTeX commands in the Markdown text itself, that’s not going to work. You’d have to start by writing an extension for the Markdown parser that recognizes the elements you want to parse as LaTeX, so that they have their own nodes. At that point, parseMixed can be used to parse those nodes with latexLanguage.parser.