Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Code comments preceding a string to trigger language-appropriate syntax highlighting #693

Open
brettz9 opened this issue Apr 7, 2021 · 0 comments

Comments

@brettz9
Copy link

brettz9 commented Apr 7, 2021

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.

image

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:

  1. It is not working for me at present
  2. It just seems like something which ought to be supported

Thanks!

Additional context

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant