PebbleTemplates / pebble

Java Template Engine
https://pebbletemplates.io
BSD 3-Clause "New" or "Revised" License
1.09k stars 166 forks source link

Expression (ContextVariableExpression) name printing in strictVariables = false mode #658

Open latyika94 opened 1 year ago

latyika94 commented 1 year ago

Hi Guys!

I am planning to use Pebble in my application for templating application mails. It's nearly perfect for my usecase, but i do not know how to solve the following problem.

I want to render mail templates on maintenance page on web browser in strictVariables = false mode for users, where they can see more or less how would the mail will be sent with resolved expressions. On maintenance page rendering the template is not a problem, but in strictVariables = false mode every expression became null or "" empty string.

There is a way displaying expression name instead of empty string / null value?

How is looking now: image

What i want to achive: image

Unfortunately i can not provide map of expressions with dummy values in this screen.

Thanks!