I’m looking to extend CodeMirror 6 to support YAML front matter within Markdown files, using @codemirror/lang-markdown and @codemirror/lang-yaml . I need the editor to highlight YAML front matter at the top and the rest as Markdown. Does anyone know how to set this up or is there any working example for CM6
I tested this and the behavior appears correct. However, the design seems counterintuitive and I would like to clarify my understanding.
The Markdown language is extensible through MarkdownConfig. In this case, we are wrapping the Markdown language with another language named yamlFrontmatter. Structurally, this makes frontmatter appear to be the primary language while Markdown becomes the embedded one, which seems opposite to the intended purpose.
Am I misunderstanding the design here? Thanks for reading!