Subject: | Text::Handlebars bug |
Date: | Tue, 17 Sep 2013 13:30:48 -0700 |
To: | bug-Text-Handlebars [...] rt.cpan.org |
From: | Jason Younker <jason [...] ynkr.org> |
Given the following:
Show quoted text
> my $handlebars = Text::Handlebars->new;
> my $tmpl = qq`
> <script>
> {{{json}}};
> </script>
>
> {{#if json}}
> {{{json}}}
>
> <div>
> {{{json}}};
> </div>
>
> <script>
> {{{json}}};
> </script>
>
> {{/if}}`;
> $handlebars->render_string($tmpl, {json => '{"foo":"bar"}'});
The HTML produced is:
Show quoted text> <script> {"foo":"bar"}; </script>
> {"foo":"bar"}
> <div> {"foo":"bar"}; </div>
> <script> {"foo":"bar"}; </script>
The best I can tell, json inside a script tag inside a conditional will be escaped despite triple braces.
Jason