Currently, an attribute can take the following schema (this is an example that illustrates all the possible items that can be included in an attribute):
There currently is no way to suggest that an attribute may contain something other than a string. For instance, the above attribute, onclick, takes a JavaScript expression. Thus, the attribute should format its contents as JavaScript, not as plaintext.
Since onclick is a supported attribute, JavaScript syntax highlighting within it is already supported:
It would be great if we could extend this to custom attributes using a new property such as 'contentType' that would allow one to opt in to different content types. For instance, Alpine.js has a custom attribute called @click that would be styled as plain text when using custom data, but should be styled as JavaScript.
Currently, an attribute can take the following schema (this is an example that illustrates all the possible items that can be included in an attribute):
There currently is no way to suggest that an attribute may contain something other than a string. For instance, the above attribute,
onclick
, takes a JavaScript expression. Thus, the attribute should format its contents as JavaScript, not as plaintext.Since
onclick
is a supported attribute, JavaScript syntax highlighting within it is already supported:It would be great if we could extend this to custom attributes using a new property such as 'contentType' that would allow one to opt in to different content types. For instance, Alpine.js has a custom attribute called
@click
that would be styled as plain text when using custom data, but should be styled as JavaScript.