Nested Syntax Highlighting
Something I do often is to write Markdown for Grav. Something common about that with many other systems is the front matter of the document written in YAML, with the remained in Markdown.
Another example might be Twig in HTML (file.html.twig).
So I'd like to request some way to nest syntax highlighting.
I know such a demand exists. However because CotEditor was not originally designed to have multiple syntax styles in a document at the same time, it requires a fundamental specification change. Therefore it's actually not realistic that I invest a good deal of my time and effort to it, at least for the present.
related: #293
Nested syntaxes are quite pervasive in web development: HTML files will often have CSS and Javascript inside
Also, with the popularisation of pre-processor languages - such as LESS, SASS, Typescript, HAML and Pug - more and more developers are mixing multiple languages to suit their programming styles.
I often write CMS templates using Pug intermixed with the template's PHP code. All my styles are written in LESS - which I choose over SASS because it can be run in the browser directly, and therefore also embedded into HMTL.
The main reason I looked at CotEditor in the first place was precisely because I was looking for an editor that would handle syntax highlighting of Pug+PHP better than Sublime Text or Atom (which do these very poorly). If this feature were added, it would certainly attract a few interested web developers...
The main reason I looked at CotEditor in the first place was precisely because I was looking for an editor that would handle syntax highlighting of Pug+PHP better than Sublime Text or Atom (which do these very poorly). If this feature were added, it would certainly attract a few interested web developers...
It would attract me for sure. I write mostly VueJS single file components, which have HTML, CSS, and JavaScript highlighting in one file.
I'd like to add another vote for this. Although we are longtime users of CotEditor, we ended up having to buy another Nova license just to get this feature, since without proper highlighting it's very easy to break the front matter.
We're mainly looking for support for YAML front matter in Markdown files, but it would be great if other front matter formats such as TOML could also be supported.