[Common] Adjust meta.embedded vs. meta.interpolation
inspired by #3051
This commit aligns meta.embedded and meta.interpolation scopes across HTML and its template languages.
The rule of thumb being applied is:
-
declarative syntaxes (CSS, JSON) or those executed at runtime (JS) are not scoped meta.embedded nor meta.interpolation. They are treated as belonging to HTML
It's wrong value of
<div style="...">being scopedmeta.interpolationas this is not what interpolation is. -
tags interpreted or executed by a pre-processor or template engine are scoped meta.embedded regardless they appear in normal text or strings.
A template engine's interpreter does not know anything about HTML or any other top-level syntax. It just interprets
embeddedspecial tokens.Some engines such as php distinguish statements
<?...?>and expressions<?= ...?>with the latter ones often used to expand to strings (acting like interpolation). Both are still scopedmeta.embeddedas distinction is not possible in all template syntaxes and some of them even provide additional real string interpolation constructs. -
only real string interpolations are scoped meta.interpolation, which most likely are part of an embedded templating language itself.
ERB provides
#{var}interpolation to be used everywhere, for instance.