DEV Community

Cover image for Only JavaScript gets template strings' syntax highlighting
Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

Only JavaScript gets template strings' syntax highlighting

html-in-template-string

Of course, I know well that Markdown is the only another language that have non-parent language syntax highlighting. (with triple-backticks + language name)

Furthermore, TypeScript also gets error checking.

template-string-error-checking

Oops, I forgot string += ts[i]

Along with JSX, JavaScript and TypeScript can easily be the second most highlighted languages in the world; second only to Markdown.

There is also fake template string literal (via VSCode IDE only)

Thanks to Comment tagged templates

comment-tagged


Although not really that popular. Only 1K installs...

Discussion (7)

Collapse
lionelrowe profile image
lionel-rowe

It's not unique to JS or TS. Ruby has this enabled even without extensions in VS Code, using the heredoc syntax.

Collapse
patarapolw profile image
Pacharapol Withayasakpunt Author • Edited on

Nice. Maybe Shell can have this kind of guide-to-syntax-hightlighting as well?

Indeed, I complained because Python, Kotlin and Go don't have this feature.

Collapse
sharpninja profile image
The Sharp Ninja • Edited on

ASP.Net has had mixed code syntax highlighting in ASPX pages since 2001 with Visual Studio.net. Actually, I'm pretty sure Visual Studio 7 did mixed highlighting in ASP 3 pages before that.

Collapse
zoedreams profile image
☮️✝️☪️🕉☸️✡️☯️

there are dozens of plugins that can do this.

Collapse
patarapolw profile image
Pacharapol Withayasakpunt Author

Does not exist, if not mentioned. Saying such does not help people learn.

I mean specifically Python, Java and Golang.

Collapse
stereobooster profile image
stereobooster

I know a lot of examples for JS stereobooster.com/posts/awesome-ta..., but not much examples for other languages

Collapse
zoedreams profile image
☮️✝️☪️🕉☸️✡️☯️

awh yes for those language yes there isn't something that does that