Better syntax highlighting for html-like template literals


Could we get better syntax highlighting for html inside tagged template literals?

See, no code for html elements.


For reference, compare to GitHub.


Hi Jorge,

Thanks for the suggestion :sunglasses:

We’re using the stock syntax highlighting from Code Mirror, so their GitHub repo might be a better place for that request. If the syntax highlighting on their demo page does a better job than Gomix, let us know and we’ll double-check that we’ve got the most up-to-date version :sparkles:


I had a similar request, both for syntax highlighting, but also for general editor functionality with template literals. Maybe it’s not possible because a string could be literally anything but there are a lot of libraries, yo-yo for instance, that use the literal to pass HTML around. When you are doing this it breaks indentation and other common HTML features that are present normally. That’s a tough one maybe but it would be an awesome feature for anyone using modern lightweight JS libs like Choo or Yo-Yo


Hi Paul,

At least for jsx, there is this workaround I wrote about in a different post: Syntax highlighting for jsx in .js files?, which basically sets the syntax highlight to jsx for javascript files.

Let us know if you find it useful :slight_smile: