use strict; use warnings; use Test::More; use Text::Xslate; plan skip_all => "unimplemented"; my $tx = Text::Xslate->new(syntax => 'Handlebars'); # XXX I'm not sure how helpers should be registered in Perl # in JS, it's global which is crappy # Text::Xslate->new has a "function" parameter for registering helpers Handlebars->registerHelper(noop => sub { my ($context, $options) = @_; return $options->{fn}->($context); }); is( $tx->render_string( '
{{#noop}}{{body}}{{/noop}}
', { title => 'A', body => 'the first letter' }, ), 'the first letter
', ); Handlebars->registerHelper(list => sub { my ($items, $options) = @_; my $out = "