Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was 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

Description

@brettz9

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions