Page MenuHomePhabricator

Differential syntax highlighting can't handle ES6 backtick strings
Closed, ResolvedPublic

Description

Steps to reproduce:

Create a diff that includes Javascript with ES6 template strings `like this`.

Expected behavior:
Template strings are highlighted like a string

Actual behavior:
Backticks are ignored, sometimes causing syntax highlighting to break completely, like if there is an unmatched single or double quote in the string.

Version:
phabricator 2d495e97014d2834f76cdff9bc392a16b51428df (Fri, Jan 15)

arcanist b87138356a9c71ad5e08eaa05399d0233529bc71 (Fri, Jan 15)

phutil c3fd3a8bb2c319982279ead972354c8bf760145c (Thu, Jan 14)

Event Timeline

Do you have pygments enabled?

epriestley claimed this task.
epriestley added a subscriber: epriestley.

Pygments added support a couple of months ago but hasn't released a version with support yet. See:

https://bitbucket.org/birkenfeld/pygments-main/issues/1100/add-support-for-ecmascript-6

So either:

  • update to HEAD of pygments; or
  • go convince them to cut a release, then update to that; or
  • contribute a standalone JS fragment lexer to the Phabricator upstream (see D3336 and D14292 for examples).