-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
Description
There are many subtly different ways of embedding one syntax into another:
- The host language clearly defines boundaries, between which we can use a completely independent highlighting process. It's the case with
<script>..</script>
in HTML. - The host language defines boundaries, but the closing boundary can only happen at the top level of the sublanguage. This the case of PHP in HTML, where
?>
inside a PHP comment wouldn't end the sublanguage. - The sublanguage ends when it parses out a single top-level mode. This is the case of JSX.
Current implementation of subLanguage
only works for the first case. And the skip
attribute only fixes a few common cases.
Current idea is to implement sublanguages as sub-parsers embedded in the host parser tree.