The issue is that Pygments does not support highlighting Twig. It supports highlighting Jinja (a Python templating language).

And being written for Python devs, Jinja does not support this ternary operator. Instead, it has [inline if expressions](http://jinja.pocoo.org/docs/templates/#if-expression)