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...

Top comments (5)

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

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
 
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 • Edited

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
 
squigglybob profile image
squigglybob