adobe/htl-spec

Support nested ternary

robotnewyork opened this issue · 2 comments

Nested ternary in HTL / Sightly causes error.

Nested ternary operators are allowed in grammar and work without any issues for me, eg.:

${'something' ? 'a' : ('1' ? 'x' : 'x')} // prints a
${'' ? 'a' : ('1' ? 'x' : 'x')} // prints x

Nested expressions have to be enclosed in parentheses. If it's not the case, then I think you should post snippet that does not work.

Thanks, I did not realize nested expressions had to be enclosed in parenthesis. Closing issue.