RexOps / Rex

Rex, the friendly automation framework
https://www.rexify.org
716 stars 223 forks source link

Semicolon in code block output breaks template_ng #799

Open ferki opened 9 years ago

ferki commented 9 years ago

The following template can be successfully processed by both the old and the new templating engine:

<%= 1 %>

It obviously returns 1.

However the following template can only be successfully processed by the old engine (the only difference is a semicolon):

<%= 1; %>

Template::NG fails with a syntax error, because it tries to process it internally as:

$self->__out( 1; );
ferki commented 9 years ago

ps.: looks like there's a similar problem with } in the code block output too

ferki commented 9 years ago

Hmm, actually (some?) other template engines doesn't seem to support these cases either (based on reading Mojo::Template docs so far). Maybe Rex should just fail with a nicer error message?