Code comments preceding a string to trigger language-appropriate syntax highlighting #693
Description
Summary
Allow code comments like /* html */
which immediately precede a string to trigger language-appropriate syntax highlighting.
Motivation
One sometimes has strings which one does not need or want to use a tagged template literal before it, but does want to trigger highlighting.
In some circumstances, like with hyperHTML, while I can name my render
function as html
to get the benefits of syntax highlighting, when I have children like within a map
that returns a string, the string should not be passed to the same html
render function, so the inner content does not get the benefit of syntax highlighting.
Describe alternatives you've considered
I could use another function which has its own html
, but this is not practical, especially given that it helps to see smaller bits of template content within the larger template when manageable in size.
language-javascript-plus
was doing this for a while, but:
- It is not working for me at present
- It just seems like something which ought to be supported
Thanks!